From 2288124be9854caeb1fdcb9337b17a801805b207 Mon Sep 17 00:00:00 2001 From: "Hermann D. Schimpf" Date: Wed, 12 Apr 2023 09:22:32 -0400 Subject: [PATCH] FIX: Update flag in current instance --- src/RegisteredWorker.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/RegisteredWorker.php b/src/RegisteredWorker.php index ad23603..0575c41 100644 --- a/src/RegisteredWorker.php +++ b/src/RegisteredWorker.php @@ -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;