debug cron
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
# Exécute la tâche cron toutes les heures
|
# Exécute la tâche cron toutes les heures
|
||||||
*/5 * * * * /app/python manage.py runcrons > /var/logs/runcrons.logs
|
*/5 * * * * python /app/manage.py runcrons > /var/log/runcrons.logs
|
||||||
|
@@ -8,7 +8,7 @@ class InitTaskSync(CronJobBase):
|
|||||||
RUN_EVERY_MIN = 1
|
RUN_EVERY_MIN = 1
|
||||||
|
|
||||||
schedule = Schedule(run_every_mins=RUN_EVERY_MIN,)
|
schedule = Schedule(run_every_mins=RUN_EVERY_MIN,)
|
||||||
code = 'mycaldav.init_sync_task' # Un code unique pour votre tâche cron
|
code = 'reskreen.init_sync_task' # Un code unique pour votre tâche cron
|
||||||
|
|
||||||
def do(self):
|
def do(self):
|
||||||
django.setup()
|
django.setup()
|
||||||
|
@@ -47,7 +47,8 @@ class caldav_sync_manager(models.Model):
|
|||||||
today = datetime.now()
|
today = datetime.now()
|
||||||
o_caldav_sync_management = caldav_sync_manager.objects.filter(dtDate=today.date())
|
o_caldav_sync_management = caldav_sync_manager.objects.filter(dtDate=today.date())
|
||||||
if not o_caldav_sync_management.exists():
|
if not o_caldav_sync_management.exists():
|
||||||
self.copy_caldav_data()
|
self.copy_caldav_data()
|
||||||
|
print(f"synced events")
|
||||||
else:
|
else:
|
||||||
print("pas de copy, sync déjà fait")
|
print("pas de copy, sync déjà fait")
|
||||||
|
|
||||||
@@ -69,6 +70,7 @@ class caldav_sync_manager(models.Model):
|
|||||||
sabre_data = o_url.read()
|
sabre_data = o_url.read()
|
||||||
|
|
||||||
events = recurring_ical_events.of(Calendar.from_ical(sabre_data)).at((seeked_date.year,seeked_date.month,seeked_date.day))
|
events = recurring_ical_events.of(Calendar.from_ical(sabre_data)).at((seeked_date.year,seeked_date.month,seeked_date.day))
|
||||||
|
#print(f"events:{events}")
|
||||||
|
|
||||||
|
|
||||||
for event in events:
|
for event in events:
|
||||||
|
Reference in New Issue
Block a user