From 522201c44e82f3797f1c9d580d2fdf57f7ee80cc Mon Sep 17 00:00:00 2001 From: Luca Faggianelli Date: Fri, 9 Jun 2023 17:57:36 +0200 Subject: [PATCH 1/5] save logs timestamp as utc time fix #132 --- src/plombery/logger/formatter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plombery/logger/formatter.py b/src/plombery/logger/formatter.py index 42cbef62..72eb1b8b 100644 --- a/src/plombery/logger/formatter.py +++ b/src/plombery/logger/formatter.py @@ -1,5 +1,6 @@ import logging import json +from time import gmtime DEFAULT_LOG_ATTRIBUTES = { @@ -34,6 +35,9 @@ def __init__( self.default_msec_format = msec_format self.datefmt = None + # Store log timestamp in UTC time + self.converter = gmtime + def usesTime(self) -> bool: """ Overwritten to look for the attribute in the format dict values instead of the fmt string. From 2b02da85e97e07a1b0d0e20c59ddce808e39d203 Mon Sep 17 00:00:00 2001 From: Luca Faggianelli Date: Fri, 9 Jun 2023 18:46:22 +0200 Subject: [PATCH 2/5] store datetimes as utc this applies to all datetimes, in the database and in the logs fix #132 --- frontend/src/components/Tasks.tsx | 4 ++-- src/plombery/database/models.py | 17 +++++++++++++++-- src/plombery/orchestrator/executor.py | 14 +++++++++----- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/Tasks.tsx b/frontend/src/components/Tasks.tsx index 6b1afa50..d8f195a7 100644 --- a/frontend/src/components/Tasks.tsx +++ b/frontend/src/components/Tasks.tsx @@ -40,7 +40,7 @@ const RunsTasksList: React.FC = ({ pipeline, run }) => { {pipeline.tasks.map((task, i) => ( - {run.tasks_run[i] ? ( + {run.tasks_run && run.tasks_run[i] ? ( = ({ pipeline, run }) => { )} - {run.tasks_run[i]?.has_output && ( + {run.tasks_run && run.tasks_run[i]?.has_output && (