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":
|
case "ANILIST_UPDATES":
|
||||||
const anilistUpdateBody =
|
const anilistUpdateBody =
|
||||||
message.body as QueueBody["ANILIST_UPDATES"];
|
message.body as QueueBody["ANILIST_UPDATES"];
|
||||||
|
console.log("queue run", message.body);
|
||||||
switch (anilistUpdateBody.updateType) {
|
switch (anilistUpdateBody.updateType) {
|
||||||
case AnilistUpdateType.UpdateWatchStatus:
|
case AnilistUpdateType.UpdateWatchStatus:
|
||||||
if (!anilistUpdateBody[AnilistUpdateType.UpdateWatchStatus]) {
|
if (!anilistUpdateBody[AnilistUpdateType.UpdateWatchStatus]) {
|
||||||
|
|||||||
@@ -276,12 +276,14 @@ export class AnilistDurableObject extends DurableObject {
|
|||||||
|
|
||||||
const result = await fetcher();
|
const result = await fetcher();
|
||||||
await this.state.storage.put(key, result);
|
await this.state.storage.put(key, result);
|
||||||
|
console.debug(`Retrieved alarms from cache:`, Object.entries(alarms));
|
||||||
|
|
||||||
const calculatedTtl = typeof ttl === "function" ? ttl(result) : ttl;
|
const calculatedTtl = typeof ttl === "function" ? ttl(result) : ttl;
|
||||||
|
|
||||||
if (calculatedTtl && calculatedTtl > 0) {
|
if (calculatedTtl && calculatedTtl > 0) {
|
||||||
const alarmTime = Date.now() + calculatedTtl;
|
const alarmTime = Date.now() + calculatedTtl;
|
||||||
await this.state.storage.setAlarm(alarmTime);
|
await this.state.storage.setAlarm(alarmTime);
|
||||||
|
console.debug(`Deleting storage key ${storageKey} & alarm ${key}`);
|
||||||
await this.state.storage.put(`alarm:${key}`, alarmTime);
|
await this.state.storage.put(`alarm:${key}`, alarmTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user