File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,12 @@ public function sleep(int $seconds): void
103103 /**
104104 * Update the processing timeout
105105 *
106+ * @param int $timeout
106107 * @return void
107108 */
108- public function updateProcessingTimeout (): void
109+ public function updateProcessingTimeout (int $ timeout = 60 ): void
109110 {
110- $ this ->processing_timeout = time ();
111+ $ this ->processing_timeout = time () + $ timeout ;
111112 }
112113
113114 /**
@@ -119,15 +120,15 @@ public function updateProcessingTimeout(): void
119120 */
120121 final public function work (int $ timeout , int $ memory ): void
121122 {
122- [$ this ->processing_timeout , $ jobs_processed ] = [time (), 0 ];
123+ [$ this ->processing_timeout , $ jobs_processed ] = [time () + $ timeout , 0 ];
123124
124125 if ($ this ->supportsAsyncSignals ()) {
125126 $ this ->listenForSignals ();
126127 }
127128
128129 while (true ) {
129130 try {
130- $ this ->updateProcessingTimeout ();
131+ $ this ->updateProcessingTimeout ($ timeout );
131132 $ this ->run ($ this ->queue );
132133 } finally {
133134 $ this ->sleep ($ this ->sleep );
You can’t perform that action at this time.
0 commit comments