From e58b55e40c1a561e48e61263b1fdec68f171545e Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 20 Jun 2022 17:39:18 -0400 Subject: [PATCH] round times for the benefit of sqlite, which will apparently not do this for integer columns --- bin/recreate_db | 2 +- .../services/process_instance_processor.py | 4 ++-- .../services/process_instance_service.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/recreate_db b/bin/recreate_db index 48333041..aecee6d3 100755 --- a/bin/recreate_db +++ b/bin/recreate_db @@ -16,7 +16,7 @@ if [[ "${1:-}" == "clean" ]]; then rm -rf migrations/ fi - rm -f ./src/spiffworkflow_backend/db*.sqlite3 + rm -f ./src/instance/*.sqlite3 mysql -uroot -e "DROP DATABASE IF EXISTS spiffworkflow_backend_development" mysql -uroot -e "DROP DATABASE IF EXISTS spiffworkflow_backend_testing" fi diff --git a/src/spiffworkflow_backend/services/process_instance_processor.py b/src/spiffworkflow_backend/services/process_instance_processor.py index 0f46c16b..20b589cf 100644 --- a/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/src/spiffworkflow_backend/services/process_instance_processor.py @@ -341,11 +341,11 @@ class ProcessInstanceProcessor: self.process_instance_model.last_updated = datetime.utcnow() if self.process_instance_model.start_in_seconds is None: - self.process_instance_model.start_in_seconds = time.time() + self.process_instance_model.start_in_seconds = round(time.time()) if self.process_instance_model.end_in_seconds is None: if self.bpmn_process_instance.is_completed(): - self.process_instance_model.end_in_seconds = time.time() + self.process_instance_model.end_in_seconds = round(time.time()) db.session.add(self.process_instance_model) db.session.commit() diff --git a/src/spiffworkflow_backend/services/process_instance_service.py b/src/spiffworkflow_backend/services/process_instance_service.py index 146e02bc..88131236 100644 --- a/src/spiffworkflow_backend/services/process_instance_service.py +++ b/src/spiffworkflow_backend/services/process_instance_service.py @@ -38,7 +38,7 @@ class ProcessInstanceService: process_model_identifier=process_model_identifier, process_group_identifier=process_group_identifier, last_updated=datetime.now(), - start_in_seconds=time.time(), + start_in_seconds=round(time.time()), ) db.session.add(process_instance_model) db.session.commit()