Ejemplo n.º 1
0
        Timer(30.0, lambda: os.kill(os.getpid(), signal.SIGUSR1)).start()

if env.cache_static:
    http_caching.compile_assets(website)
    website.request_processor.dispatcher.build_dispatch_tree()
elif env.clean_assets:
    http_caching.clean_assets(website.www_root)
    website.request_processor.dispatcher.build_dispatch_tree()

# Periodic jobs
# =============

conf = website.app_conf
if conf:
    intervals = conf.cron_intervals
    cron = Cron(website)
    cron(intervals.get('check_db', 600), website.db.self_check, True)
    cron(intervals.get('dequeue_emails', 60), Participant.dequeue_emails, True)
    cron(intervals.get('send_newsletters', 60), Participant.send_newsletters,
         True)
    cron(intervals.get('refetch_elsewhere_data', 120), refetch_elsewhere_data,
         True)
    cron(intervals.get('refetch_repos', 60), refetch_repos, True)
    cron(Weekly(weekday=3, hour=2), create_payday_issue, True)
    cron(intervals.get('clean_up_counters', 3600),
         website.db.clean_up_counters, True)
    cron(Daily(hour=16), lambda: fetch_currency_exchange_rates(website.db),
         True)
    cron(Daily(hour=17), Payday.update_cached_amounts, True)
    cron(Daily(hour=8), clean_up_closed_accounts, True)
    cron(intervals.get('notify_patrons', 1200), Participant.notify_patrons,
Ejemplo n.º 2
0
        timers.append(Timer(30.0, lambda: os.kill(os.getpid(), signal.SIGUSR1)))
    timers[-1].start()

if env.cache_static:
    http_caching.compile_assets(website)
    website.request_processor.dispatcher.build_dispatch_tree()
elif env.clean_assets:
    http_caching.clean_assets(website.www_root)
    website.request_processor.dispatcher.build_dispatch_tree()


# Periodic jobs
# =============

conf = website.app_conf
cron = website.cron = Cron(website)
if conf:
    intervals = conf.cron_intervals
    cron(intervals.get('check_db', 600), website.db.self_check, True)
    cron(intervals.get('dequeue_emails', 60), Participant.dequeue_emails, True)
    cron(intervals.get('send_newsletters', 60), Participant.send_newsletters, True)
    cron(intervals.get('send_account_disabled_notifications', 600), send_account_disabled_notifications, True)
    cron(intervals.get('refetch_elsewhere_data', 120), refetch_elsewhere_data, True)
    cron(intervals.get('refetch_repos', 60), refetch_repos, True)
    cron(Weekly(weekday=3, hour=2), create_payday_issue, True)
    cron(intervals.get('clean_up_counters', 3600), website.db.clean_up_counters, True)
    cron(Daily(hour=1), clean_up_emails, True)
    cron(Daily(hour=2), reschedule_renewals, True)
    cron(Daily(hour=3), send_upcoming_debit_notifications, True)
    cron(Daily(hour=4), execute_scheduled_payins, True)
    cron(Daily(hour=8), clean_up_closed_accounts, True)