Skip to content

Commit

Permalink
Fix setting a null time limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorial1024 committed Jan 4, 2025
1 parent f3d5d73 commit c6bfccc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/AsyncTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ public function run(): void
register_shutdown_function([$this, 'shutdownCheckTaskTimeout']);
if (OsInfo::isWindows()) {
// windows can just use PHP's time limit
set_time_limit($this->timeLimit);
if ($this->timeLimit > 0) {
set_time_limit($this->timeLimit);
}
} else {
// assume anything not Windows to be Unix
// we already set it to kill this task after the timeout, so we just need to install a listener to catch the signal and exit gracefully
Expand Down

0 comments on commit c6bfccc

Please sign in to comment.