chore: add debug logging to help understand why episode updates won't run
This commit is contained in:
@@ -291,11 +291,13 @@ export class AnilistDurableObject extends DurableObject {
|
||||
async alarm() {
|
||||
const now = Date.now();
|
||||
const alarms = await this.state.storage.list({ prefix: "alarm:" });
|
||||
console.debug(`Retrieved alarms from cache:`, Object.entries(alarms));
|
||||
for (const [key, ttl] of Object.entries(alarms)) {
|
||||
if (now >= ttl) {
|
||||
// The key in alarms is `alarm:${storageKey}`
|
||||
// We want to delete the storageKey
|
||||
const storageKey = key.replace("alarm:", "");
|
||||
console.debug(`Deleting storage key ${storageKey} & alarm ${key}`);
|
||||
await this.state.storage.delete(storageKey);
|
||||
await this.state.storage.delete(key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user