Skip to content

Commit

Permalink
Try to inherit TaskQueue from the parent when ContinueAsNew options D…
Browse files Browse the repository at this point in the history
…TO is created
  • Loading branch information
roxblnfk committed Jul 2, 2024
1 parent fc78a23 commit 77328e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Workflow/ContinueAsNewOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Temporal\Internal\Support\DateInterval;
use Temporal\Worker\WorkerFactoryInterface;
use Temporal\Worker\Worker;
use Temporal\Workflow;

/**
* @psalm-import-type DateIntervalValue from DateInterval
Expand Down Expand Up @@ -55,6 +56,12 @@ public function __construct()
{
$this->workflowRunTimeout = CarbonInterval::seconds(0);
$this->workflowTaskTimeout = CarbonInterval::seconds(0);
try {
// Inherit TaskQueue from the current Workflow if possible
$this->taskQueue = Workflow::getInfo()->taskQueue;
} catch (\Throwable) {
// Do nothing
}
}

/**
Expand Down

0 comments on commit 77328e3

Please sign in to comment.