From d81f5e64cdb76188b00ae22fbace4555796d0863 Mon Sep 17 00:00:00 2001 From: Fabio Date: Wed, 15 Feb 2023 11:11:53 -0300 Subject: [PATCH] New audiencias-cron script --- .../v0.4.0/templates/audienciasweb-cron.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/charts/edemocracia/v0.4.0/templates/audienciasweb-cron.yaml b/charts/edemocracia/v0.4.0/templates/audienciasweb-cron.yaml index a657c14..cc66055 100644 --- a/charts/edemocracia/v0.4.0/templates/audienciasweb-cron.yaml +++ b/charts/edemocracia/v0.4.0/templates/audienciasweb-cron.yaml @@ -27,11 +27,15 @@ spec: command: [ "/bin/bash", "-c" ] args: - >- - sleep $[RANDOM%120]; - python3 /var/labhacker/audiencias/manage.py prune_rooms; - python3 /var/labhacker/audiencias/manage.py prune_presences; - [[ ! -z "$WEBSERVICE_URL" ]] && - python3 /var/labhacker/audiencias/manage.py get_camara_webservice + TIME=$[RANDOM%120]; + echo Sleeping $TIME seconds...; + sleep $TIME; + echo Running prune_rooms... && python3 /var/labhacker/audiencias/manage.py prune_rooms; + echo Running prune_presences... && python3 /var/labhacker/audiencias/manage.py prune_presences; + if [[ ! -z "$WEBSERVICE_URL" ]]; then + echo Running get_camara_webservice... && + python3 /var/labhacker/audiencias/manage.py get_camara_webservice; + fi; env: - name: ADMIN_EMAIL value: {{ .Values.edemocracia.admin.email | quote }}