fix the issue
Closed
fix the issue
3 open threads
3 open threads
Merge request reports
Activity
535 536 // Determine when to stop batching. 536 537 $sandbox['current'] = ($sandbox['total'] - count($sandbox['items_to_process'])); 537 538 // Save the 'current' value to state, to record a successful processOne(). 538 $this->state->set($sandbox['multi_run_state_key'], $sandbox['current']); 539 if (isset($sandbox['multi_run_state_key'])) { 563 566 564 567 $this->logger->info("$logged_message </br> $summary", $vars); 565 568 566 // Delete the state as it is no longer needed. 567 $this->state->delete($sandbox['multi_run_state_key']); 569 // Delete the state as it is no longer needed if 'multi_run_state_key' is set. 435 435 return; 436 436 } 437 437 $this->checkAndSetCanRun($this->executor); 438 $sandbox['multi_run_state_key'] = "cbo_{$script_name}"; 438 // Initialize multi_run_state_key if not set 439 $sandbox['multi_run_state_key'] = isset($sandbox['multi_run_state_key']) ? $sandbox['multi_run_state_key'] : "cbo_{$script_name}"; Thank you for submitting this PR. I think the changes you are recommending solve the possibility of warning, but they also alter how the code behaves.
After looking at the code closer as a result of this PR, the only way this warning could ever appear, is if sandbox_init was not run first or if $sandbox['total'] was not empty on the very first run.
I have not seen this warning come up with my own eyes, but if it came up it is a sign of a bigger problem, that can not be fixed by being more defensive of $sandbox['multi_run_state_key']. I think the warning is n effect of something else, not the cause.
Please register or sign in to reply