Update Redis key for Monday message tracking to

This commit is contained in:
Jeppe Bundgaard
2026-03-02 12:30:11 +01:00
parent c1145495a0
commit 3d4f9d9973
+3 -3
View File
@@ -185,10 +185,10 @@ function GoalsProgressAlertsCron(): void
// Run department overview goals mondays
if ((int)date('N') === 1) {
// Check if the time is between 07:00 and 17:00
if (!redis->exists('system:last_sent_monday_message') && (date('H') >= 7 && date('H') < 17)) {
if (!redis->exists('system:last_sent_monday_message_v2') && (date('H') >= 7 && date('H') < 17)) {
// Set the key to expire in 24 hours
redis->set('system:last_sent_monday_message', (string)time());
redis->expire('system:last_sent_monday_message', 86400);
redis->set('system:last_sent_monday_message_v2', (string)time());
redis->expire('system:last_sent_monday_message_v2', 86400);
$department = new departments_o();
$days = 7;
// The time should be from 00:00:00 of the start date to 23:59:59 of the end date