Skip to content

Commit

Permalink
FIX: Update flag in current instance
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimpf committed Apr 12, 2023
1 parent 3cec9c1 commit 2288124
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/RegisteredWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public function getIdentifier(): string {
* @param bool $with_progress Flag to enable/disable the ProgressBar
*/
public function withProgress(bool $with_progress = true, int $steps = 0): void {
// enable with progress flag
$this->with_progress = $with_progress;

// check if caller is Runner
$caller = debug_backtrace(!DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1];
if (($caller['class'] ?? null) === Internals\Runner::class || !PARALLEL_EXT_LOADED) {
// enable with progress flag
$this->with_progress = $with_progress;
$this->steps = $steps;

return;
Expand Down

0 comments on commit 2288124

Please sign in to comment.