From 5b9377c69740db8328afe3ef176a1b033c03dd7a Mon Sep 17 00:00:00 2001 From: Imdad Ahad Date: Tue, 1 Aug 2017 11:38:25 +0100 Subject: [PATCH] Start populating monthly billing on a schedule --- app/commands.py | 2 +- app/config.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/commands.py b/app/commands.py index 99eb95608..a2e692ebd 100644 --- a/app/commands.py +++ b/app/commands.py @@ -159,7 +159,7 @@ class PopulateMonthlyBilling(Command): def run(self, service_id, year): start, end = 1, 13 if year == '2016': - start = 6 + start = 4 print('Starting populating monthly billing for {}'.format(year)) for i in range(start, end): diff --git a/app/config.py b/app/config.py index cfd37fa33..12d52df9b 100644 --- a/app/config.py +++ b/app/config.py @@ -221,6 +221,11 @@ class Config(object): 'task': 'timeout-job-statistics', 'schedule': crontab(minute=0, hour=5), 'options': {'queue': QueueNames.PERIODIC} + }, + 'populate_monthly_billing': { + 'task': 'populate_monthly_billing', + 'schedule': crontab(minute=10, hour=5), + 'options': {'queue': QueueNames.PERIODIC} } } CELERY_QUEUES = []