| @@ 452-469 (lines=18) @@ | ||
| 449 | ||
| 450 | // finally, find the list of broken jobs and send an email if there's some found |
|
| 451 | $brokenJobs = QueuedJobDescriptor::get()->filter('JobStatus', QueuedJob::STATUS_BROKEN); |
|
| 452 | if ($brokenJobs && $brokenJobs->count()) { |
|
| 453 | $this->getLogger()->error( |
|
| 454 | print_r( |
|
| 455 | [ |
|
| 456 | 'errno' => 0, |
|
| 457 | 'errstr' => 'Broken jobs were found in the job queue', |
|
| 458 | 'errfile' => __FILE__, |
|
| 459 | 'errline' => __LINE__, |
|
| 460 | 'errcontext' => [], |
|
| 461 | ], |
|
| 462 | true |
|
| 463 | ), |
|
| 464 | [ |
|
| 465 | 'file' => __FILE__, |
|
| 466 | 'line' => __LINE__, |
|
| 467 | ] |
|
| 468 | ); |
|
| 469 | } |
|
| 470 | ||
| 471 | return $stalledJobs->count(); |
|
| 472 | } |
|
| @@ 954-972 (lines=19) @@ | ||
| 951 | if ($jobDescriptor) { |
|
| 952 | $this->copyJobToDescriptor($job, $jobDescriptor); |
|
| 953 | $jobDescriptor->write(); |
|
| 954 | } else { |
|
| 955 | $this->getLogger()->error( |
|
| 956 | print_r( |
|
| 957 | [ |
|
| 958 | 'errno' => 0, |
|
| 959 | 'errstr' => 'Job descriptor has been set to null', |
|
| 960 | 'errfile' => __FILE__, |
|
| 961 | 'errline' => __LINE__, |
|
| 962 | 'errcontext' => [], |
|
| 963 | ], |
|
| 964 | true |
|
| 965 | ), |
|
| 966 | [ |
|
| 967 | 'file' => __FILE__, |
|
| 968 | 'line' => __LINE__, |
|
| 969 | ] |
|
| 970 | ); |
|
| 971 | $broken = true; |
|
| 972 | } |
|
| 973 | } |
|
| 974 | ||
| 975 | // a last final save. The job is complete by now |
|