Skip to content

Commit

Permalink
Fix error when unserialize return false
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tourze authored Jan 11, 2024
1 parent 8fa5b79 commit 0078149
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,9 @@ protected static function formatProcessStatusData(): string
} catch (Throwable) {
// do nothing
}
if (!is_array($workerInfo)) {
$workerInfo = [];
}
ksort($workerInfo, SORT_NUMERIC);
unset($info[0]);
$dataWaitingSort = [];
Expand Down

0 comments on commit 0078149

Please sign in to comment.