diff --git a/crontab b/crontab index f1c7ed3..6e644f3 100644 --- a/crontab +++ b/crontab @@ -1,2 +1,2 @@ -*/5 * * * * python /var/www/request-broker/manage.py runcrons >/proc/1/fd/1 2>/proc/1/fd/2 +*/5 * * * * /usr/local/bin/python3 -u /var/www/request-broker/manage.py runcrons >/proc/1/fd/1 2>/proc/1/fd/2 diff --git a/request_broker/cron.py b/request_broker/cron.py index bb26b48..941f7ec 100644 --- a/request_broker/cron.py +++ b/request_broker/cron.py @@ -1,11 +1,11 @@ from django_cron import CronJobBase, Schedule from process_request.helpers import refresh_reading_room_cache -import settings +from request_broker.settings import AEON class RefreshReadingRoomCache(CronJobBase): - schedule = Schedule(run_every_mins=settings.AEON["cache_duration"]) + schedule = Schedule(run_every_mins=AEON["cache_duration"]) code = 'request_broker.refresh_reading_room_cache' def do(self): - refresh_reading_room_cache() \ No newline at end of file + refresh_reading_room_cache() diff --git a/request_broker/settings.py b/request_broker/settings.py index 8440a4d..2834bef 100644 --- a/request_broker/settings.py +++ b/request_broker/settings.py @@ -177,3 +177,7 @@ "apikey": config.AEON_APIKEY, "cache_duration": config.AEON_CACHE_DURATION, } + +CRON_CLASSES = [ + "request_broker.cron.RefreshReadingRoomCache" +]