I have this function: ``` async function exhaustAlarms(stub: DurableObjectStub) { let count = 0

I have this function:

async function exhaustAlarms(stub: DurableObjectStub) {
    let count = 0;
    while (true) {
        let ran = await runDurableObjectAlarm(stub)    
        // await new Promise(resolve => setTimeout(resolve, 100))
        if (!ran) {
            break
        };
        count++;
    }
    return count;
}


If I don't add some small delay (see the setTimeout), I get this issue:

workerd/io/worker.c++:2082: info: uncaught exception; source = Uncaught (in promise); stack = Error: Durable Object storage is no longer accessible.
Was this page helpful?