V1.30.6 cron settings
This commit is contained in:
parent
83736df898
commit
52212fb949
@ -5,7 +5,7 @@ RUN /usr/local/bin/python -m pip install --upgrade pip
|
|||||||
RUN apt-get update && apt-get install vim -y
|
RUN apt-get update && apt-get install vim -y
|
||||||
RUN apt-get -y install cron
|
RUN apt-get -y install cron
|
||||||
# Copy cron file to the cron.d directory
|
# Copy cron file to the cron.d directory
|
||||||
COPY aitrainer-cron /etc/cron.d/hello-cron
|
COPY aitrainer-cron /etc/cron.d/aitrainer-cron
|
||||||
|
|
||||||
# Give execution rights on the cron job
|
# Give execution rights on the cron job
|
||||||
RUN chmod 0644 /etc/cron.d/aitrainer-cron
|
RUN chmod 0644 /etc/cron.d/aitrainer-cron
|
||||||
|
@ -1 +1 @@
|
|||||||
*/30 * * * * python /aitrainer_backoffice_aitrainer_backoffice/manage.py runcrons --settings aitrainer_backoffice.settings.deploy > /var/log/cronjob.log
|
*/5 * * * * python /aitrainer_backoffice/aitrainer_backoffice/manage.py runcrons --settings aitrainer_backoffice.settings.deploy >> /var/log/cronjob.log
|
||||||
|
@ -8,6 +8,7 @@ class Notification:
|
|||||||
fcm = FCM()
|
fcm = FCM()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
print("** Running Notification automation")
|
||||||
notification_queryset = notif.Notification.objects.using('live').raw('SELECT * from notification WHERE active = 1')
|
notification_queryset = notif.Notification.objects.using('live').raw('SELECT * from notification WHERE active = 1')
|
||||||
|
|
||||||
for notification in notification_queryset:
|
for notification in notification_queryset:
|
||||||
|
@ -15,7 +15,7 @@ class MyCronJob(CronJobBase):
|
|||||||
|
|
||||||
class NotificationJob(CronJobBase):
|
class NotificationJob(CronJobBase):
|
||||||
notif = Notification()
|
notif = Notification()
|
||||||
RUN_EVERY_MINS = 60
|
RUN_EVERY_MINS = 5
|
||||||
schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
|
schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
|
||||||
code = 'aitrainer_backoffice.controlling.notification' # a unique code
|
code = 'aitrainer_backoffice.controlling.notification' # a unique code
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user