Skip to content

Commit 9093267

Browse files
committed
fix orchestration context
Signed-off-by: Robert Landers <landers.robert@gmail.com>
1 parent fcd3556 commit 9093267

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/OrchestrationContext.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ final class OrchestrationContext implements OrchestrationContextInterface
7171

7272
private int $randomKey = 0;
7373

74+
private StateId $from;
75+
7476
public function callActivity(string $name, ?string $returnType = null, ?RetryOptions $retryOptions = null, mixed ...$args): DurableFuture
7577
{
7678
$this->durableLogger->debug('Calling activity', ['name' => $name]);
@@ -141,10 +143,7 @@ private function createFuture(
141143

142144
private function addFrom(Event $event): Event
143145
{
144-
static $from = null;
145-
$from ??= StateId::fromInstance($this->id);
146-
147-
return WithFrom::forEvent($from, $event);
146+
return WithFrom::forEvent($this->from, $event);
148147
}
149148

150149
public function callActivityInline(Closure $activity): DurableFuture
@@ -583,6 +582,7 @@ public function __construct(
583582
private readonly Provenance $user,
584583
) {
585584
$this->history->historicalTaskResults->setCurrentTime(MonotonicClock::current()->now());
585+
$this->from = StateId::fromInstance($this->id);
586586
}
587587

588588
public function entityOp(EntityId|string $id, Closure $operation): mixed

0 commit comments

Comments
 (0)