Created
April 3, 2012 19:27
-
-
Save rande/2294925 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {@inheritdoc} | |
*/ | |
public function getStatus() | |
{ | |
$states = $this->messageManager->countStates(); | |
if ($states[MessageInterface::STATE_OPEN] > $this->checkLevel[MessageInterface::STATE_OPEN]) { | |
return new BackendStatus(BackendStatus::CRITICAL, 'Too much messages waiting to be processed'); | |
} | |
if ($states[MessageInterface::STATE_IN_PROGRESS] > $this->checkLevel[MessageInterface::STATE_IN_PROGRESS]) { | |
return new BackendStatus(BackendStatus::FAILURE, 'Too many messages processed at the same time'); | |
} | |
if ($states[MessageInterface::STATE_ERROR] > $this->checkLevel[MessageInterface::STATE_ERROR]) { | |
return new BackendStatus(BackendStatus::FAILURE, 'Too many errors'); | |
} | |
if ($states[MessageInterface::STATE_DONE] > $this->checkLevel[MessageInterface::STATE_DONE]) { | |
return new BackendStatus(BackendStatus::CRITICAL, 'Too many processed messages, please clean the database'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment