| @@ 776-784 (lines=9) @@ | ||
| 773 | ); |
|
| 774 | break; |
|
| 775 | } |
|
| 776 | if ($jobDescriptor->JobStatus != QueuedJob::STATUS_RUN) { |
|
| 777 | // we've been paused by something, so we'll just exit |
|
| 778 | $job->addMessage(_t( |
|
| 779 | __CLASS__ . '.JOB_PAUSED', |
|
| 780 | 'Job paused at {time}', |
|
| 781 | ['time' => DBDatetime::now()->Rfc2822()] |
|
| 782 | )); |
|
| 783 | $broken = true; |
|
| 784 | } |
|
| 785 | ||
| 786 | if (!$broken) { |
|
| 787 | // Inject real-time log handler |
|
| @@ 872-882 (lines=11) @@ | ||
| 869 | $stallCount++; |
|
| 870 | } |
|
| 871 | ||
| 872 | if ($stallCount > static::config()->get('stall_threshold')) { |
|
| 873 | $broken = true; |
|
| 874 | $job->addMessage( |
|
| 875 | _t( |
|
| 876 | __CLASS__ . '.JOB_STALLED', |
|
| 877 | 'Job stalled after {attempts} attempts - please check', |
|
| 878 | ['attempts' => $stallCount] |
|
| 879 | ) |
|
| 880 | ); |
|
| 881 | $jobDescriptor->JobStatus = QueuedJob::STATUS_BROKEN; |
|
| 882 | } |
|
| 883 | ||
| 884 | // now we'll be good and check our memory usage. If it is too high, we'll set the job to |
|
| 885 | // a 'Waiting' state, and let the next processing run pick up the job. |
|