This commit is contained in:
2024-04-12 15:23:33 +02:00
parent 640cde1ba7
commit 2b9483fd17
2 changed files with 3 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y cron
RUN chmod 0644 /etc/cron.d/django_crons_jobs && crontab /etc/cron.d/django_crons_jobs && touch /var/log/cron.log RUN chmod 0644 /etc/cron.d/django_crons_jobs && crontab /etc/cron.d/django_crons_jobs && touch /var/log/cron.log
RUN apt update && apt install cron && pip install --no-cache-dir -r requirements.txt RUN docpip install --no-cache-dir -r requirements.txt
RUN python manage.py makemigrations && python manage.py migrate RUN python manage.py makemigrations && python manage.py migrate

View File

@@ -5,8 +5,9 @@ import django
class InitTaskSync(CronJobBase): class InitTaskSync(CronJobBase):
RUN_AT_TIMES = ['07:00', '19:00'] RUN_AT_TIMES = ['07:00', '19:00']
RUN_EVERY_MIN = 1
schedule = Schedule(run_at_times=RUN_AT_TIMES,) schedule = Schedule(run_every_mins=RUN_EVERY_MIN,)
code = 'mycaldav.init_sync_task' # Un code unique pour votre tâche cron code = 'mycaldav.init_sync_task' # Un code unique pour votre tâche cron
def do(self): def do(self):