28 lines
805 B
Python
28 lines
805 B
Python
from ..automation.notification import NotificationExec
|
|
from django_cron import CronJobBase, Schedule
|
|
import datetime
|
|
|
|
|
|
class MyCronJob(CronJobBase):
|
|
|
|
RUN_EVERY_MINS = 60
|
|
schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
|
|
code = 'aitrainer_backoffice.controlling.cron' # a unique code
|
|
|
|
def do(self):
|
|
print(datetime.datetime.now(), " *** START sync customers ")
|
|
|
|
|
|
class NotificationJob(CronJobBase):
|
|
notif = NotificationExec()
|
|
RUN_EVERY_MINS = 5
|
|
schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
|
|
code = 'aitrainer_backoffice.controlling.notification' # a unique code
|
|
|
|
def do(self):
|
|
print(datetime.datetime.now(), " *** START notification ")
|
|
self.notif.run()
|
|
print(datetime.datetime.now(), " *** END notification ")
|
|
|
|
|