Skip to content

Commit

Permalink
cron fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrysanthemum Lovelace authored and chryslovelace committed Jun 7, 2023
1 parent 28e1f82 commit 9c76649
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crontab
Original file line number Diff line number Diff line change
@@ -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

6 changes: 3 additions & 3 deletions request_broker/cron.py
Original file line number Diff line number Diff line change
@@ -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()
refresh_reading_room_cache()
4 changes: 4 additions & 0 deletions request_broker/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,7 @@
"apikey": config.AEON_APIKEY,
"cache_duration": config.AEON_CACHE_DURATION,
}

CRON_CLASSES = [
"request_broker.cron.RefreshReadingRoomCache"
]

0 comments on commit 9c76649

Please sign in to comment.