Skip to content

Commit

Permalink
Ignore time limit when run from CLI.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Jul 20, 2023
1 parent 35c8c29 commit a0018fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/wp-background-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,10 @@ protected function time_exceeded() {
$finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', 20 ); // 20 seconds
$return = false;

if ( time() >= $finish ) {
if (
! ( defined( 'WP_CLI' ) && WP_CLI ) &&
time() >= $finish
) {
$return = true;
}

Expand Down

0 comments on commit a0018fe

Please sign in to comment.