Skip to content

Commit 670f7cd

Browse files
committed
fix: cronjob
1 parent 1bb2928 commit 670f7cd

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

backend/src/cronjobs/ghostmode-reminder.cron.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ export class GhostModeReminderCronJob {
7777
const users = await this.userRepository
7878
.createQueryBuilder("user")
7979
.where("user.dateMode = :mode", { mode: EDateMode.GHOST })
80-
.andWhere("user.lastDateModeChange <= :timestamp", {
81-
timestamp: new Date(
82-
now.getTime() - intervalHour.hours * 60 * 60 * 1000,
83-
),
84-
})
80+
.andWhere(
81+
"user.lastDateModeChange IS NULL OR user.lastDateModeChange <= :timestamp",
82+
{
83+
timestamp: new Date(
84+
now.getTime() -
85+
intervalHour.hours * 60 * 60 * 1000,
86+
),
87+
},
88+
)
8589
.andWhere(
8690
"user.lastDateModeReminderSent IS NULL OR user.lastDateModeReminderSent < :reminderTimestamp",
8791
{

0 commit comments

Comments
 (0)