Quick question around durable objects and setAlarm. Since Date.now() will only return the time of th

Quick question around durable objects and setAlarm. Since Date.now() will only return the time of the last IO, the below example may set the alarm to a past time. Is this correct? Is the alarm still guaranteed to execute in that case?

  async alarm() {
    // Perform something that could take up to 15 seconds
    await doSomething();
    // Schedule task for the next second
    this.state.storage.setAlarm(Date.now() + parseDuration('1s'));
  }
Was this page helpful?