debug cron

This commit is contained in:
2024-04-12 16:25:39 +02:00
parent 81d1243d6d
commit ec313b6636
3 changed files with 5 additions and 3 deletions

View File

@@ -1,2 +1,2 @@
# 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

View File

@@ -8,7 +8,7 @@ class InitTaskSync(CronJobBase):
RUN_EVERY_MIN = 1
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):
django.setup()

View File

@@ -47,7 +47,8 @@ class caldav_sync_manager(models.Model):
today = datetime.now()
o_caldav_sync_management = caldav_sync_manager.objects.filter(dtDate=today.date())
if not o_caldav_sync_management.exists():
self.copy_caldav_data()
self.copy_caldav_data()
print(f"synced events")
else:
print("pas de copy, sync déjà fait")
@@ -69,6 +70,7 @@ class caldav_sync_manager(models.Model):
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))
#print(f"events:{events}")
for event in events: