Browse Source

Avoid rapid infinite loop exit

walkor 8 years ago
parent
commit
6f89c2314a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Worker.php

+ 4 - 0
Worker.php

@@ -1550,9 +1550,13 @@ class Worker
                 call_user_func($this->onWorkerStart, $this);
                 call_user_func($this->onWorkerStart, $this);
             } catch (\Exception $e) {
             } catch (\Exception $e) {
                 self::log($e);
                 self::log($e);
+                // Avoid rapid infinite loop exit.
+                sleep(1);
                 exit(250);
                 exit(250);
             } catch (\Error $e) {
             } catch (\Error $e) {
                 self::log($e);
                 self::log($e);
+                // Avoid rapid infinite loop exit.
+                sleep(1);
                 exit(250);
                 exit(250);
             }
             }
         }
         }