Skip to content
Snippets Groups Projects
Verified Commit 1bb66544 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Update end-time when workflow execution is canceled

#26
parent 1ad664e1
No related branches found
No related tags found
2 merge requests!69Delete dev branch,!23Resolve "Update endtime when workflow is canceled"
Pipeline #27724 passed
from uuid import UUID
from clowmdb.models import WorkflowExecution
from sqlalchemy import delete, or_, select, update
from sqlalchemy import delete, or_, select, text, update
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import joinedload
......@@ -146,7 +146,7 @@ class CRUDWorkflowExecution:
stmt = (
update(WorkflowExecution)
.where(WorkflowExecution._execution_id == eid)
.values(status=WorkflowExecution.WorkflowExecutionStatus.CANCELED.name)
.values(status=WorkflowExecution.WorkflowExecutionStatus.CANCELED.name, end_time=text("CURRENT_TIMESTAMP"))
)
await db.execute(stmt)
await db.commit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment