Skip to content

Commit

Permalink
Fix test_auto_registration_workflow_remote flake #2
Browse files Browse the repository at this point in the history
Changed approach to mitigate the issue.

Change-Id: I268c0908709b22a28075f4c6a0f6ca8178dc3275
  • Loading branch information
LarsMichelsen committed Nov 30, 2024
1 parent 5f5e10f commit 325d9c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmk/gui/watolib/_sync_remote_sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ def execute(self, api_request: int) -> str:
# This reduces the probability to break the logic of automated processes. This has the
# advantage that we can do it in this central place. The disadvantage is that the changes
# are synced later to the central site, which seems to be acceptable.
site_changes = [c for c in SiteChanges(site_id).read() if c["time"] < time.time() - 600]
site_changes = SiteChanges(site_id).read()
# We could filter out the changes within the 600 seconds if clear-site-changes would only
# delete the synced changes. To deal with that we don't sync any change if there is a
# change within the last 600 seconds.
if max(c["time"] for c in site_changes) > time.time() - 600:
site_changes = []

return SyncRemoteSitesResult(audit_logs, site_changes).to_json()

Expand Down

0 comments on commit 325d9c7

Please sign in to comment.