mirror of https://git.48k.eu/ogserver
#997 Fix og_tm_hours_mask
Tests formastere68fefe
were made after 00pm (12:00) so we did not cover <12:00 cases for immediate commands that are logged (scheduled for the exact moment they are processed and ignored the fact they are stale so they are executed right away) In addition, libdbi was complaining about the data type used to represent the hours, they were not being inserted properly. From syslog: failed to query database (og_dbi_schedule_create:3288) 1264: Out of range value for column 'horas' at row 1 Fix og_tm_hours_mask so <12:00 immediate schedule is handled correctly. Change return type to uint16_t, as the 'hours' column type is smallint(4) Fixese68fefe
("#997 Set stale check flag when processing schedule/create")
parent
8b7b5f33a1
commit
41bc66d0e7
|
@ -3497,9 +3497,9 @@ static uint32_t og_tm_months_mask(struct tm *tm)
|
|||
return 1 << tm->tm_mon;
|
||||
}
|
||||
|
||||
static uint32_t og_tm_hours_mask(struct tm *tm)
|
||||
static uint16_t og_tm_hours_mask(struct tm *tm)
|
||||
{
|
||||
return 1 << (tm->tm_hour - 12);
|
||||
return tm->tm_hour >= 12 ? 1 << (tm->tm_hour - 12) : 1 << tm->tm_hour;
|
||||
}
|
||||
|
||||
static uint32_t og_tm_ampm(struct tm *tm)
|
||||
|
|
Loading…
Reference in New Issue