From 011f04d14590dd93c4210d1e05812c6f46d12154 Mon Sep 17 00:00:00 2001 From: Enzo Date: Mon, 11 Dec 2023 15:11:24 +0100 Subject: [PATCH] update --- Dockerfile | 4 +++- crontab | 4 ++-- generateurModele.py | 4 ++-- testFinal.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1bcb66d..c9674a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,10 @@ COPY generateurModele.py . COPY testFinal.py . COPY crontab . +RUN touch /app/cron.log + RUN chmod 0644 /app/crontab RUN apt-get update RUN apt-get -y install cron -ENTRYPOINT ["cron"] \ No newline at end of file +CMD cron && tail -f /app/cron.log \ No newline at end of file diff --git a/crontab b/crontab index 8408a52..40cb9e4 100644 --- a/crontab +++ b/crontab @@ -1,3 +1,3 @@ -00 08 * * * python generateurModele.py -* * * * * python testFinal.py +* * * * * python testFinal.py >> /app/cron.log 2>&1 +00 08 * * * python generateurModele.py >> /app/cron.log 2>&1 diff --git a/generateurModele.py b/generateurModele.py index b486105..ab55e67 100644 --- a/generateurModele.py +++ b/generateurModele.py @@ -54,8 +54,8 @@ def sendJsonToApi(url,json): return # ---------------- Main ------------------- # -# Mettre la route de l'api ICI -urlGetAllData = "https://codefirst.iut.uca.fr/containers/SmartFit-smartfit_api/IA" +logging.error("RUNNNNNNNN !") +urlGetAllData = "https://codefirst.iut.uca.fr/containers/SmartFit-smartfit_api/ia/data" while(True): logging.warning("Info - Début de la boucle") jsonBack = { "Users" : []} diff --git a/testFinal.py b/testFinal.py index 0ea9d41..8716ace 100644 --- a/testFinal.py +++ b/testFinal.py @@ -53,7 +53,7 @@ def sendJsonToApi(url,json): return # ---------------- Main ------------------- # -logging.warning("RUNNNNNNNN !") +logging.error("RUNNNNNNNN !") urlGetAllData = "https://codefirst.iut.uca.fr/containers/SmartFit-smartfit_api/ia/data"