Skip to content

Commit

Permalink
WIP query db alarm time a little less
Browse files Browse the repository at this point in the history
  • Loading branch information
jclee committed Sep 17, 2024
1 parent 9d6d2dc commit e7d6809
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/workerd/io/actor-sqlite.c++
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,9 @@ kj::Maybe<kj::Own<void>> ActorSqlite::armAlarmHandler(kj::Date scheduledTime, bo
KJ_ASSERT(!haveDeferredDelete);
KJ_ASSERT(!inAlarmHandler);

if (metadata.getAlarm() != scheduledTime) {
if (metadata.getAlarm() == lastConfirmedAlarmDbState) {
auto localAlarmState = metadata.getAlarm();
if (localAlarmState != scheduledTime) {
if (localAlarmState == lastConfirmedAlarmDbState) {
// If there's a clean scheduledTime that is different from ours, this run should be
// canceled.
// TODO(now): should probably also check that no other db requests are in-flight?
Expand Down

0 comments on commit e7d6809

Please sign in to comment.