mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Cosmetic fix to * cron
This commit is contained in:
parent
affb30e9f4
commit
a57d55504d
@ -19,8 +19,17 @@ def offset_cron(schedule: crontab) -> crontab:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
cron_offset = CronOffset.get_solo()
|
cron_offset = CronOffset.get_solo()
|
||||||
new_minute = [(m + (round(60 * cron_offset.minute))) % 60 for m in schedule.minute]
|
|
||||||
new_hour = [(m + (round(24 * cron_offset.hour))) % 24 for m in schedule.hour]
|
# Stops this shit from happening 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23
|
||||||
|
# It is only cosmetic, but still annoying
|
||||||
|
if schedule._orig_minute == '*':
|
||||||
|
new_minute = '*'
|
||||||
|
else:
|
||||||
|
new_minute = [(m + (round(60 * cron_offset.minute))) % 60 for m in schedule.minute]
|
||||||
|
if schedule._orig_hour == '*':
|
||||||
|
new_hour = '*'
|
||||||
|
else:
|
||||||
|
new_hour = [(m + (round(24 * cron_offset.hour))) % 24 for m in schedule.hour]
|
||||||
|
|
||||||
return crontab(
|
return crontab(
|
||||||
minute=",".join(str(m) for m in sorted(new_minute)),
|
minute=",".join(str(m) for m in sorted(new_minute)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user