Created
March 16, 2015 10:20
-
-
Save Mezzle/c51c035dbfd2159755eb to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* getQueueFailures | |
* | |
* @return array[][] | |
*/ | |
protected function getQueueFailures() | |
{ | |
$resque = $this->getServiceLocator()->get('Resque'); | |
/** @var \CRedis_Client $redis */ | |
$redis = $resque->redis()->driver; | |
$failure_count = $redis->llen('resque:failed'); | |
$failures = []; | |
$failures_json = $redis->lRange('resque:failed', 0, $failure_count - 1); | |
foreach ($failures_json as $id => $failure) { | |
$failure = json_decode($failure, true); | |
$failures[$failure['queue']][] = | |
[ | |
'id' => $id, | |
'failure' => $failure | |
]; | |
} | |
return $failures; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment