@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | - * @return mixed |
|
30 | + * @return integer |
|
31 | 31 | */ |
32 | 32 | public function getMaxFailures() |
33 | 33 | { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
38 | - * @param mixed $maxFailure |
|
38 | + * @param mixed $maxFailures |
|
39 | 39 | */ |
40 | 40 | public function setMaxFailures($maxFailures) |
41 | 41 | { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
124 | - * @return mixed |
|
124 | + * @return integer |
|
125 | 125 | */ |
126 | 126 | public function getMaxExceptions() |
127 | 127 | { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
132 | - * @param mixed $maxException |
|
132 | + * @param mixed $maxExceptions |
|
133 | 133 | */ |
134 | 134 | public function setMaxExceptions($maxExceptions) |
135 | 135 | { |
@@ -83,7 +83,7 @@ |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
86 | - * @param int|null $defaultMaxStalled |
|
86 | + * @param integer|null $defaultMaxStalls |
|
87 | 87 | */ |
88 | 88 | public function setDefaultMaxStalls($defaultMaxStalls) |
89 | 89 | { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @param RetryableJob $job |
23 | - * @param $retry bool |
|
23 | + * @param boolean $retry bool |
|
24 | 24 | * |
25 | 25 | * @return |
26 | 26 | */ |
@@ -65,6 +65,10 @@ discard block |
||
65 | 65 | return $this->updateJobMax($job, 'Exceptions', RetryableJob::STATUS_MAX_EXCEPTIONS, $this->autoRetryOnException); |
66 | 66 | } |
67 | 67 | |
68 | + /** |
|
69 | + * @param string $type |
|
70 | + * @param boolean $autoRetry |
|
71 | + */ |
|
68 | 72 | protected function updateJobMax(RetryableJob $job, $type, $maxStatus, $autoRetry) |
69 | 73 | { |
70 | 74 | $setMethod = 'set'.$type; |
@@ -171,7 +175,7 @@ discard block |
||
171 | 175 | } |
172 | 176 | |
173 | 177 | /** |
174 | - * @param int|null $defaultMaxFailure |
|
178 | + * @param integer|null $defaultMaxFailures |
|
175 | 179 | */ |
176 | 180 | public function setDefaultMaxFailures($defaultMaxFailures) |
177 | 181 | { |
@@ -219,7 +223,7 @@ discard block |
||
219 | 223 | } |
220 | 224 | |
221 | 225 | /** |
222 | - * @param int|null $defaultMaxException |
|
226 | + * @param integer|null $defaultMaxExceptions |
|
223 | 227 | */ |
224 | 228 | public function setDefaultMaxExceptions($defaultMaxExceptions) |
225 | 229 | { |
@@ -26,6 +26,9 @@ discard block |
||
26 | 26 | protected $hostname; |
27 | 27 | protected $pid; |
28 | 28 | |
29 | + /** |
|
30 | + * @param string $cacheKeyPrefix |
|
31 | + */ |
|
29 | 32 | public function __construct(RunManager $runManager, JobTimingManager $jobTimingManager, $jobClass, $cacheKeyPrefix) |
30 | 33 | { |
31 | 34 | $this->cacheKeyPrefix = $cacheKeyPrefix; |
@@ -45,6 +48,9 @@ discard block |
||
45 | 48 | return $this->cacheKeyPrefix.'_job_'.$jobId; |
46 | 49 | } |
47 | 50 | |
51 | + /** |
|
52 | + * @param string $jobCrc |
|
53 | + */ |
|
48 | 54 | protected function getJobCrcHashKey($jobCrc) |
49 | 55 | { |
50 | 56 | return $this->cacheKeyPrefix.'_job_crc_'.$jobCrc; |
@@ -107,6 +113,10 @@ discard block |
||
107 | 113 | return null; |
108 | 114 | } |
109 | 115 | |
116 | + /** |
|
117 | + * @param string $foundJobCacheKey |
|
118 | + * @param boolean $foundJobMessage |
|
119 | + */ |
|
110 | 120 | protected function batchFoundJob(\Dtc\QueueBundle\Redis\Job $job, $foundJobCacheKey, $foundJobMessage) |
111 | 121 | { |
112 | 122 | $when = $job->getWhenUs(); |
@@ -132,6 +142,10 @@ discard block |
||
132 | 142 | return $this->finishBatchFoundJob($foundJob, $foundJobCacheKey, $crcCacheKey, $newFoundWhen, $newFoundPriority); |
133 | 143 | } |
134 | 144 | |
145 | + /** |
|
146 | + * @param string $crcCacheKey |
|
147 | + * @param integer|null $newFoundPriority |
|
148 | + */ |
|
135 | 149 | protected function finishBatchFoundJob(Job $foundJob, $foundJobCacheKey, $crcCacheKey, $newFoundWhen, $newFoundPriority) |
136 | 150 | { |
137 | 151 | // Now how do we adjust this job's priority or time? |
@@ -151,6 +165,9 @@ discard block |
||
151 | 165 | return $this->addFoundJob($adjust, $foundJob, $foundJobCacheKey, $crcCacheKey); |
152 | 166 | } |
153 | 167 | |
168 | + /** |
|
169 | + * @param boolean $adjust |
|
170 | + */ |
|
154 | 171 | protected function addFoundJob($adjust, Job $foundJob, $foundJobCacheKey, $crcCacheKey) |
155 | 172 | { |
156 | 173 | $whenQueue = $this->getWhenQueueCacheKey(); |
@@ -168,6 +185,9 @@ discard block |
||
168 | 185 | return $result ?: false; |
169 | 186 | } |
170 | 187 | |
188 | + /** |
|
189 | + * @param string $queue |
|
190 | + */ |
|
171 | 191 | private function adjustJob($adjust, $queue, Job $foundJob, $foundJobCacheKey, $crcCacheKey, $zScore) |
172 | 192 | { |
173 | 193 | if ($adjust && $this->redis->zRem($queue, $foundJob->getId()) > 0) { |
@@ -188,7 +208,7 @@ discard block |
||
188 | 208 | /** |
189 | 209 | * @param \Dtc\QueueBundle\Model\Job $job |
190 | 210 | * |
191 | - * @return \Dtc\QueueBundle\Model\Job |
|
211 | + * @return Job|null |
|
192 | 212 | * |
193 | 213 | * @throws ClassNotSubclassException |
194 | 214 | */ |
@@ -307,6 +327,9 @@ discard block |
||
307 | 327 | } |
308 | 328 | } |
309 | 329 | |
330 | + /** |
|
331 | + * @param string $workerName |
|
332 | + */ |
|
310 | 333 | protected function verifyGetJobArgs($workerName = null, $methodName = null, $prioritize = true) |
311 | 334 | { |
312 | 335 | if (null !== $workerName || null !== $methodName || (null !== $this->maxPriority && true !== $prioritize)) { |