Skip to content

Commit

Permalink
fix bug in pipeline expiring/deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
motey committed Dec 10, 2024
1 parent a63ebae commit c2a2762
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions backend/mekeweserver/pipeline_status_clerk.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,10 @@ def get_next_pipeline_that_is_expired(
pipeline_status = MetaKeggPipelineDef.model_validate_json(
pipeline_state_json_raw
)
if self.is_pipeline_run_expired(pipeline_status):
if (
self.is_pipeline_run_expired(pipeline_status)
and pipeline_status.state != "expired"
):
if set_status_expired:
pipeline_status.state = "expired"
self.set_pipeline_run_definition(pipeline_status)
Expand Down Expand Up @@ -460,7 +463,7 @@ def is_pipeline_run_deletable(self, pipeline_status: MetaKeggPipelineDef):
minutes=config.PIPELINE_RESULT_EXPIRED_AFTER_MIN
)
deleteable_datetime = expire_datetime + datetime.timedelta(
minutes=config.PIPELINE_ABANDONED_DEFINITION_DELETED_AFTER
minutes=config.PIPELINE_RESULT_DELETED_AFTER_MIN
)
if deleteable_datetime < datetime.datetime.now(tz=datetime.timezone.utc):
return True
Expand Down
Loading

0 comments on commit c2a2762

Please sign in to comment.