| @@ 217-226 (lines=10) @@ | ||
| 214 | return \ResqueScheduler::getDelayedQueueScheduleSize(); |
|
| 215 | } |
|
| 216 | ||
| 217 | public function getJobsForTimestamp($timestamp) |
|
| 218 | { |
|
| 219 | $jobs = \Resque::redis()->lrange('delayed:'.$timestamp, 0, -1); |
|
| 220 | $out = array(); |
|
| 221 | foreach ($jobs as $job) { |
|
| 222 | $out[] = json_decode($job, true); |
|
| 223 | } |
|
| 224 | ||
| 225 | return $out; |
|
| 226 | } |
|
| 227 | ||
| 228 | /** |
|
| 229 | * @param $queue |
|
| @@ 240-251 (lines=12) @@ | ||
| 237 | return $length; |
|
| 238 | } |
|
| 239 | ||
| 240 | public function getFailedJobs($start = -100, $count = 100) |
|
| 241 | { |
|
| 242 | $jobs = \Resque::redis()->lrange('failed', $start, $count); |
|
| 243 | ||
| 244 | $result = array(); |
|
| 245 | ||
| 246 | foreach ($jobs as $job) { |
|
| 247 | $result[] = new FailedJob(json_decode($job, true)); |
|
| 248 | } |
|
| 249 | ||
| 250 | return $result; |
|
| 251 | } |
|
| 252 | ||
| 253 | /** |
|
| 254 | * Attach any applicable retry strategy to the job. |
|