Skip to content

Commit ef498cd

Browse files
committed
fix: auto-schedule alarm on actor start (#887)
1 parent 489dfdb commit ef498cd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/actor-core/src/actor/instance.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ export class ActorInstance<S, CP, CS, V> {
200200
}
201201
}
202202

203+
// Set alarm for next scheduled event if any exist after finishing initiation sequence
204+
if (this.#persist.e.length > 0) {
205+
await this.#actorDriver.setAlarm(this, this.#persist.e[0].t);
206+
}
207+
203208
logger().info("actor ready");
204209
this.#ready = true;
205210
}

0 commit comments

Comments
 (0)