File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -50,12 +50,20 @@ export class TinyDO extends WsServerDurableObject<Env> {
50
50
nextAlarm = nextAlarmDate . getTime ( )
51
51
52
52
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
+ )
54
57
nextAlarmDate . setUTCDate ( nextAlarmDate . getUTCDate ( ) + 1 )
55
58
nextAlarm = nextAlarmDate . getTime ( )
56
59
} 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
+ )
58
64
}
65
+ } else {
66
+ console . log ( `[Alarm] Setting next alarm in ${ this . currentInterval / 1000 } s` , new Date ( nextAlarm ) . toISOString ( ) )
59
67
}
60
68
61
69
this . ctx . storage . setAlarm ( nextAlarm )
You can’t perform that action at this time.
0 commit comments