@@ -87,7 +87,6 @@ |
||
87 | 87 | |
88 | 88 | /** |
89 | 89 | * @param ContainerBuilder $container |
90 | - * @param string $jobClass |
|
91 | 90 | */ |
92 | 91 | protected function setupTaggedServices(ContainerBuilder $container, Definition $definition) |
93 | 92 | { |
@@ -110,6 +110,10 @@ discard block |
||
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | + /** |
|
114 | + * @param string $workerName |
|
115 | + * @param string $method |
|
116 | + */ |
|
113 | 117 | public function pruneExpiredJobs($workerName = null, $method = null) |
114 | 118 | { |
115 | 119 | $count = $this->updateExpired($workerName, $method); |
@@ -234,6 +238,10 @@ discard block |
||
234 | 238 | } |
235 | 239 | } |
236 | 240 | |
241 | + /** |
|
242 | + * @param integer $i |
|
243 | + * @param integer $count |
|
244 | + */ |
|
237 | 245 | protected function runStalledLoop($i, $count, array $stalledJobs) |
238 | 246 | { |
239 | 247 | $resetCount = 0; |
@@ -336,6 +344,9 @@ discard block |
||
336 | 344 | */ |
337 | 345 | abstract protected function stopIdGenerator($objectName); |
338 | 346 | |
347 | + /** |
|
348 | + * @param string $objectName |
|
349 | + */ |
|
339 | 350 | abstract protected function restoreIdGenerator($objectName); |
340 | 351 | |
341 | 352 | /** |
@@ -372,6 +383,9 @@ discard block |
||
372 | 383 | return $countProcessed; |
373 | 384 | } |
374 | 385 | |
386 | + /** |
|
387 | + * @param string $function |
|
388 | + */ |
|
375 | 389 | protected function resetSaveOk($function) |
376 | 390 | { |
377 | 391 | } |
@@ -51,6 +51,9 @@ discard block |
||
51 | 51 | $this->workers[$worker->getName()] = $worker; |
52 | 52 | } |
53 | 53 | |
54 | + /** |
|
55 | + * @param string $name |
|
56 | + */ |
|
54 | 57 | public function getWorker($name) |
55 | 58 | { |
56 | 59 | if (isset($this->workers[$name])) { |
@@ -70,6 +73,9 @@ discard block |
||
70 | 73 | $this->logFunc = $callable; |
71 | 74 | } |
72 | 75 | |
76 | + /** |
|
77 | + * @param string $level |
|
78 | + */ |
|
73 | 79 | public function log($level, $msg, array $context = []) |
74 | 80 | { |
75 | 81 | if ($this->logFunc) { |
@@ -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 | { |
@@ -39,8 +39,8 @@ |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * @param int $stalledCount |
|
43 | 42 | * |
43 | + * @param integer $stalls |
|
44 | 44 | * @return StallableJob |
45 | 45 | */ |
46 | 46 | public function setStalls($stalls) |
@@ -210,7 +210,7 @@ |
||
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
213 | - * @param null $workerName |
|
213 | + * @param string|null $workerName |
|
214 | 214 | * @param null $methodName |
215 | 215 | * @param bool $prioritize |
216 | 216 | * |
@@ -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; |
@@ -102,6 +108,10 @@ discard block |
||
102 | 108 | return null; |
103 | 109 | } |
104 | 110 | |
111 | + /** |
|
112 | + * @param string $foundJobCacheKey |
|
113 | + * @param boolean $foundJobMessage |
|
114 | + */ |
|
105 | 115 | protected function batchFoundJob(\Dtc\QueueBundle\Redis\Job $job, $foundJobCacheKey, $foundJobMessage) |
106 | 116 | { |
107 | 117 | $when = $job->getWhenUs(); |
@@ -127,6 +137,10 @@ discard block |
||
127 | 137 | return $this->finishBatchFoundJob($foundJob, $foundJobCacheKey, $crcCacheKey, $newFoundWhen, $newFoundPriority); |
128 | 138 | } |
129 | 139 | |
140 | + /** |
|
141 | + * @param string $crcCacheKey |
|
142 | + * @param integer|null $newFoundPriority |
|
143 | + */ |
|
130 | 144 | protected function finishBatchFoundJob(Job $foundJob, $foundJobCacheKey, $crcCacheKey, $newFoundWhen, $newFoundPriority) |
131 | 145 | { |
132 | 146 | // Now how do we adjust this job's priority or time? |
@@ -146,6 +160,9 @@ discard block |
||
146 | 160 | return $this->addFoundJob($adjust, $foundJob, $foundJobCacheKey, $crcCacheKey); |
147 | 161 | } |
148 | 162 | |
163 | + /** |
|
164 | + * @param boolean $adjust |
|
165 | + */ |
|
149 | 166 | protected function addFoundJob($adjust, Job $foundJob, $foundJobCacheKey, $crcCacheKey) |
150 | 167 | { |
151 | 168 | $whenQueue = $this->getWhenQueueCacheKey(); |
@@ -163,6 +180,9 @@ discard block |
||
163 | 180 | return $result ?: false; |
164 | 181 | } |
165 | 182 | |
183 | + /** |
|
184 | + * @param string $queue |
|
185 | + */ |
|
166 | 186 | private function adjustJob($adjust, $queue, Job $foundJob, $foundJobCacheKey, $crcCacheKey, $zScore) |
167 | 187 | { |
168 | 188 | if ($adjust && $this->redis->zRem($queue, $foundJob->getId()) > 0) { |
@@ -183,7 +203,7 @@ discard block |
||
183 | 203 | /** |
184 | 204 | * @param \Dtc\QueueBundle\Model\Job $job |
185 | 205 | * |
186 | - * @return \Dtc\QueueBundle\Model\Job |
|
206 | + * @return null|Job |
|
187 | 207 | * |
188 | 208 | * @throws ClassNotSubclassException |
189 | 209 | */ |
@@ -302,6 +322,9 @@ discard block |
||
302 | 322 | } |
303 | 323 | } |
304 | 324 | |
325 | + /** |
|
326 | + * @param string $workerName |
|
327 | + */ |
|
305 | 328 | protected function verifyGetJobArgs($workerName = null, $methodName = null, $prioritize = true) |
306 | 329 | { |
307 | 330 | if (null !== $workerName || null !== $methodName || (null !== $this->maxPriority && true !== $prioritize)) { |
@@ -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 | */ |
@@ -44,7 +44,6 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * @return bool true if retry |
46 | 46 | * |
47 | - * @param bool $retry true if the job was retried, false if not |
|
48 | 47 | */ |
49 | 48 | public function saveHistory(Job $job) |
50 | 49 | { |
@@ -67,6 +66,10 @@ discard block |
||
67 | 66 | return $this->updateJobMax($job, 'Exceptions', RetryableJob::STATUS_MAX_EXCEPTIONS, $this->autoRetryOnException); |
68 | 67 | } |
69 | 68 | |
69 | + /** |
|
70 | + * @param string $type |
|
71 | + * @param boolean $autoRetry |
|
72 | + */ |
|
70 | 73 | protected function updateJobMax(RetryableJob $job, $type, $maxStatus, $autoRetry) |
71 | 74 | { |
72 | 75 | $setMethod = 'set'.$type; |
@@ -121,7 +124,6 @@ discard block |
||
121 | 124 | } |
122 | 125 | |
123 | 126 | /** |
124 | - * @param RetryableJob $retryableJob |
|
125 | 127 | * |
126 | 128 | * @return bool true if the job was successfully "reset", i.e. re-queued |
127 | 129 | */ |
@@ -157,7 +159,7 @@ discard block |
||
157 | 159 | } |
158 | 160 | |
159 | 161 | /** |
160 | - * @param int|null $defaultMaxRetry |
|
162 | + * @param integer|null $defaultMaxRetries |
|
161 | 163 | */ |
162 | 164 | public function setDefaultMaxRetries($defaultMaxRetries) |
163 | 165 | { |
@@ -173,7 +175,7 @@ discard block |
||
173 | 175 | } |
174 | 176 | |
175 | 177 | /** |
176 | - * @param int|null $defaultMaxFailure |
|
178 | + * @param integer|null $defaultMaxFailures |
|
177 | 179 | */ |
178 | 180 | public function setDefaultMaxFailures($defaultMaxFailures) |
179 | 181 | { |
@@ -221,7 +223,7 @@ discard block |
||
221 | 223 | } |
222 | 224 | |
223 | 225 | /** |
224 | - * @param int|null $defaultMaxException |
|
226 | + * @param integer|null $defaultMaxExceptions |
|
225 | 227 | */ |
226 | 228 | public function setDefaultMaxExceptions($defaultMaxExceptions) |
227 | 229 | { |
@@ -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 | { |