Skip to content

Commit 8ed13c5

Browse files
committed
Add log message
1 parent 8122db5 commit 8ed13c5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/server/src/worker.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,20 @@ export class TinyDO extends WsServerDurableObject<Env> {
5050
nextAlarm = nextAlarmDate.getTime()
5151

5252
if (currentHour > 21) {
53-
console.log("It's too late in the evening. Setting alarm for tomorrow", nextAlarmDate.toISOString())
53+
console.log(
54+
"[Alarm] It's too late in the evening. Setting next alarm for tomorrow",
55+
nextAlarmDate.toISOString(),
56+
)
5457
nextAlarmDate.setUTCDate(nextAlarmDate.getUTCDate() + 1)
5558
nextAlarm = nextAlarmDate.getTime()
5659
} else {
57-
console.log("It's too early in the morning. Setting alarm for 06:00 UTC", nextAlarmDate.toISOString())
60+
console.log(
61+
"[Alarm] It's too early in the morning. Setting next alarm for 06:00 UTC",
62+
nextAlarmDate.toISOString(),
63+
)
5864
}
65+
} else {
66+
console.log(`[Alarm] Setting next alarm in ${this.currentInterval / 1000}s`, new Date(nextAlarm).toISOString())
5967
}
6068

6169
this.ctx.storage.setAlarm(nextAlarm)

0 commit comments

Comments
 (0)