chore: add debug logging to help understand why episode updates won't run
This commit is contained in:
@@ -82,6 +82,7 @@ export default {
|
||||
case "ANILIST_UPDATES":
|
||||
const anilistUpdateBody =
|
||||
message.body as QueueBody["ANILIST_UPDATES"];
|
||||
console.log("queue run", message.body);
|
||||
switch (anilistUpdateBody.updateType) {
|
||||
case AnilistUpdateType.UpdateWatchStatus:
|
||||
if (!anilistUpdateBody[AnilistUpdateType.UpdateWatchStatus]) {
|
||||
|
||||
@@ -276,12 +276,14 @@ export class AnilistDurableObject extends DurableObject {
|
||||
|
||||
const result = await fetcher();
|
||||
await this.state.storage.put(key, result);
|
||||
console.debug(`Retrieved alarms from cache:`, Object.entries(alarms));
|
||||
|
||||
const calculatedTtl = typeof ttl === "function" ? ttl(result) : ttl;
|
||||
|
||||
if (calculatedTtl && calculatedTtl > 0) {
|
||||
const alarmTime = Date.now() + calculatedTtl;
|
||||
await this.state.storage.setAlarm(alarmTime);
|
||||
console.debug(`Deleting storage key ${storageKey} & alarm ${key}`);
|
||||
await this.state.storage.put(`alarm:${key}`, alarmTime);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user