From 9b5ffd2cdc6be3031540e0c240d6e0b1e520e031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 22 Mar 2023 16:49:44 -0300 Subject: [PATCH] Muda job importa_gescon para 4/4 horas --- docker/Dockerfile | 1 + sigi/apps/convenios/jobs/{daily => }/importa_gescon.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename sigi/apps/convenios/jobs/{daily => }/importa_gescon.py (70%) diff --git a/docker/Dockerfile b/docker/Dockerfile index fd53b72..007568c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -93,6 +93,7 @@ RUN mkdir -p /var/log/sigi # schedule cron jobs RUN crontab -l | { cat; echo "* * * * * /usr/local/bin/python ${HOME}/manage.py runjobs minutely >> /var/log/sigi/cron.log 2>&1"; } | crontab - RUN crontab -l | { cat; echo "0 * * * * /usr/local/bin/python ${HOME}/manage.py runjobs hourly >> /var/log/sigi/cron.log 2>&1"; } | crontab - +RUN crontab -l | { cat; echo "0 0/4 * * * /usr/local/bin/python ${HOME}/manage.py runjob importa_gescon >> /var/log/sigi/cron.log 2>&1"; } | crontab - RUN crontab -l | { cat; echo "0 0 * * * /usr/local/bin/python ${HOME}/manage.py runjobs daily >> /var/log/sigi/cron.log 2>&1"; } | crontab - RUN crontab -l | { cat; echo "0 0 * * 0 /usr/local/bin/python ${HOME}/manage.py runjobs weekly >> /var/log/sigi/cron.log 2>&1"; } | crontab - RUN crontab -l | { cat; echo "0 0 1 * * /usr/local/bin/python ${HOME}/manage.py runjobs monthly >> /var/log/sigi/cron.log 2>&1"; } | crontab - diff --git a/sigi/apps/convenios/jobs/daily/importa_gescon.py b/sigi/apps/convenios/jobs/importa_gescon.py similarity index 70% rename from sigi/apps/convenios/jobs/daily/importa_gescon.py rename to sigi/apps/convenios/jobs/importa_gescon.py index c0c2f51..2b56f43 100644 --- a/sigi/apps/convenios/jobs/daily/importa_gescon.py +++ b/sigi/apps/convenios/jobs/importa_gescon.py @@ -2,12 +2,11 @@ import datetime import docutils.core from django.core.mail import mail_admins from django.utils.translation import gettext as _ -from django_extensions.management.jobs import DailyJob from sigi.apps.convenios.models import Gescon -from sigi.apps.utils.management.jobs import JobReportMixin +from sigi.apps.utils.management.jobs import JobReportMixin, QuarterDailyJob -class Job(JobReportMixin, DailyJob): +class Job(JobReportMixin, QuarterDailyJob): help = "Carga de dados do Gescon." def do_job(self):