소스 검색

Fix error when unserialize return false

Double check the workerInfo var.
In some cases, the unserialize will notice some tips like: unserialize(): Error at offset 0 of 54 bytes in file, but dont throw any Exception.
tourze 1 년 전
부모
커밋
007814919a
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/Worker.php

+ 3 - 0
src/Worker.php

@@ -1142,6 +1142,9 @@ class Worker
         } catch (Throwable) {
             // do nothing
         }
+        if (!is_array($workerInfo)) {
+            $workerInfo = [];
+        }
         ksort($workerInfo, SORT_NUMERIC);
         unset($info[0]);
         $dataWaitingSort = [];