@@ -53,14 +53,15 @@ class Resque_Worker
53
53
* @var Resque_Job Current job, if any, being processed by this worker.
54
54
*/
55
55
private $ currentJob = null ;
56
-
56
+
57
57
/**
58
58
* @var int Process ID of child worker processes.
59
59
*/
60
60
private $ child = null ;
61
61
62
62
/**
63
63
* Return all workers known to Resque as instantiated instances.
64
+ * @return array
64
65
*/
65
66
public static function all ()
66
67
{
@@ -192,12 +193,12 @@ public function work($interval = 5)
192
193
$ this ->child = $ this ->fork ();
193
194
194
195
// Forked and we're the child. Run the job.
195
- if ($ this ->child === 0 || $ this ->child === false ) {
196
+ if ($ this ->child === 0 || $ this ->child === false ) {
196
197
$ status = 'Processing ' . $ job ->queue . ' since ' . strftime ('%F %T ' );
197
198
$ this ->updateProcLine ($ status );
198
199
$ this ->log ($ status , self ::LOG_VERBOSE );
199
200
$ this ->perform ($ job );
200
- if ($ this ->child === 0 ) {
201
+ if ($ this ->child === 0 ) {
201
202
exit (0 );
202
203
}
203
204
}
@@ -228,11 +229,12 @@ public function work($interval = 5)
228
229
/**
229
230
* Process a single job.
230
231
*
231
- * @param object|null $job The job to be processed.
232
+ * @param Resque_Job $job The job to be processed.
232
233
*/
233
234
public function perform (Resque_Job $ job )
234
235
{
235
236
try {
237
+ $ this ->log ("afterFork being triggered " , self ::LOG_VERBOSE );
236
238
Resque_Event::trigger ('afterFork ' , $ job );
237
239
$ job ->perform ();
238
240
}
0 commit comments