| @@ 814-822 (lines=9) @@ | ||
| 811 | ); |
|
| 812 | break; |
|
| 813 | } |
|
| 814 | if ($jobDescriptor->JobStatus != QueuedJob::STATUS_RUN) { |
|
| 815 | // we've been paused by something, so we'll just exit |
|
| 816 | $job->addMessage(_t( |
|
| 817 | __CLASS__ . '.JOB_PAUSED', |
|
| 818 | 'Job paused at {time}', |
|
| 819 | ['time' => DBDatetime::now()->Rfc2822()] |
|
| 820 | )); |
|
| 821 | $broken = true; |
|
| 822 | } |
|
| 823 | ||
| 824 | if (!$broken) { |
|
| 825 | // Inject real-time log handler |
|
| @@ 910-920 (lines=11) @@ | ||
| 907 | $stallCount++; |
|
| 908 | } |
|
| 909 | ||
| 910 | if ($stallCount > static::config()->get('stall_threshold')) { |
|
| 911 | $broken = true; |
|
| 912 | $job->addMessage( |
|
| 913 | _t( |
|
| 914 | __CLASS__ . '.JOB_STALLED', |
|
| 915 | 'Job stalled after {attempts} attempts - please check', |
|
| 916 | ['attempts' => $stallCount] |
|
| 917 | ) |
|
| 918 | ); |
|
| 919 | $jobDescriptor->JobStatus = QueuedJob::STATUS_BROKEN; |
|
| 920 | } |
|
| 921 | ||
| 922 | // now we'll be good and check our memory usage. If it is too high, we'll set the job to |
|
| 923 | // a 'Waiting' state, and let the next processing run pick up the job. |
|