Projet

Général

Profil

0001-misc-align-jump-checks-with-the-hourly-cron-jobs-381.patch

Frédéric Péters, 03 décembre 2019 16:14

Télécharger (3,25 ko)

Voir les différences:

Subject: [PATCH] misc: align jump checks with the "hourly" cron jobs (#38159)

 wcs/formdef.py               | 4 ++--
 wcs/qommon/ident/password.py | 4 ++--
 wcs/wf/aggregation_email.py  | 3 +--
 wcs/wf/jump.py               | 8 ++++++--
 4 files changed, 11 insertions(+), 8 deletions(-)
wcs/formdef.py
1659 1659
    # once a month, look for drafts to remove
1660 1660
    get_publisher_class().register_cronjob(CronJob(clean_drafts,
1661 1661
        name='clean_drafts',
1662
        days=[2], hours=[0], minutes=[0]))
1662
        days=[2], hours=[0], minutes=[0], hourly=True))
1663 1663
    # once a day, look for unused files
1664 1664
    get_publisher_class().register_cronjob(CronJob(clean_unused_files,
1665 1665
        name='clean_unused_files',
1666
        hours=[2], minutes=[0]))
1666
        hours=[2], minutes=[0], hourly=True))
wcs/qommon/ident/password.py
1692 1692
if get_publisher_class():
1693 1693
    # at 6:00 in the morning, every day
1694 1694
    get_publisher_class().register_cronjob(
1695
            CronJob(handle_unused_accounts, minutes=[0], hours=[6]))
1695
            CronJob(handle_unused_accounts, minutes=[0], hours=[6], hourly=True))
1696 1696
    get_publisher_class().register_cronjob(
1697
            CronJob(handle_expired_tokens, minutes=[10], hours=[6]))
1697
            CronJob(handle_expired_tokens, minutes=[10], hours=[6], hourly=True))
wcs/wf/aggregation_email.py
156 156
if get_publisher_class():
157 157
    # at 6:00 in the morning, every day but the week end
158 158
    get_publisher_class().register_cronjob(
159
            CronJob(send_aggregation_emails, minutes=[0], hours=[6], weekdays=range(5)))
160

  
159
            CronJob(send_aggregation_emails, hours=[6], minutes=[0], hourly=True, weekdays=range(5)))
wcs/wf/jump.py
19 19
import os
20 20
import sys
21 21

  
22
from django.conf import settings
22 23
from django.utils import six
23 24

  
24 25
from quixote import get_publisher, get_request, redirect
......
302 303

  
303 304
if get_publisher_class():
304 305
    # every JUMP_TIMEOUT_INTERVAL minutes check for expired status jump
305
    # timeouts.
306
    # timeouts; align checks with the "hourly" check defined in
307
    # wcs/qommon/cron.py
308
    minutes = [(x + ord(settings.SECRET_KEY[-1])) % 60
309
               for x in range(0, 60, JUMP_TIMEOUT_INTERVAL)]
306 310
    get_publisher_class().register_cronjob(
307 311
            CronJob(_apply_timeouts,
308 312
                name='evaluate_jumps',
309
                hours=range(24), minutes=range(0, 60, JUMP_TIMEOUT_INTERVAL)))
313
                hours=range(24), minutes=minutes))
310
-