File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -527,8 +527,8 @@ protected function handle() {
527527 // Let the server breathe a little.
528528 sleep ( $ throttle_seconds );
529529
530- if ( $ this -> time_exceeded () || $ this -> memory_exceeded () ) {
531- // Batch limits reached.
530+ // Batch limits reached, or pause or cancel request.
531+ if ( $ this -> time_exceeded () || $ this -> memory_exceeded () || $ this -> is_paused () || $ this -> is_cancelled () ) {
532532 break ;
533533 }
534534 }
@@ -537,7 +537,7 @@ protected function handle() {
537537 if ( empty ( $ batch ->data ) ) {
538538 $ this ->delete ( $ batch ->key );
539539 }
540- } while ( ! $ this ->time_exceeded () && ! $ this ->memory_exceeded () && ! $ this ->is_queue_empty () );
540+ } while ( ! $ this ->time_exceeded () && ! $ this ->memory_exceeded () && ! $ this ->is_queue_empty () && ! $ this -> is_paused () && ! $ this -> is_cancelled () );
541541
542542 $ this ->unlock_process ();
543543
You can’t perform that action at this time.
0 commit comments