fix(orchestrator): do not stamp or untrack every schedule when all updates/deletes fail (SIENTIAPDE-2192)

This commit is contained in:
PedroHMCosme
2026-10-07 15:18:38 -03:00
parent 6334be2edf
commit 0d3ff73557
2 changed files with 44 additions and 2 deletions

View File

@@ -242,7 +242,12 @@ class MongoDB(SientiaMonitoring):
for pipeline in updated_pipelines
if pipeline['success']
]
data_filter = {'$or': argument} if argument else {}
if not argument:
# Every update failed: stamp nothing so they are retried next tick (same guard as
# create_pipelines_timestamps). An empty filter would match every tracked schedule.
self.info('No successful pipeline updates to timestamp', metadata=metadata)
return
data_filter = {'$or': argument}
try:
self.mongo_db_repository.update_many(
@@ -343,7 +348,13 @@ class MongoDB(SientiaMonitoring):
for pipeline in deleted_pipelines
if pipeline['success']
]
data_filter = {'$or': argument} if argument else {}
if not argument:
# Every delete failed: remove nothing (same guard as create_pipelines_timestamps).
# An empty filter would wipe orchestrated_schedules and make the next tick delete
# and recreate every orchestrated schedule.
self.info('No successful pipeline deletions to untrack', metadata=metadata)
return
data_filter = {'$or': argument}
try:
self.mongo_db_repository.delete_many('orchestrated_schedules', data_filter, metadata)