round times for the benefit of sqlite, which will apparently not do this for integer columns

This commit is contained in:
burnettk 2022-06-20 17:39:18 -04:00
parent 4c9f47a32d
commit e58b55e40c
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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()

View File

@ -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()