Skip to content

Commit

Permalink
backend: unknown-resalloc-tickets: check tickets taken first
Browse files Browse the repository at this point in the history
If backend is idle, there are no used tickets - we still want to check
for all the taken tickets, and report those.
  • Loading branch information
praiskup committed Oct 1, 2024
1 parent 35a23e6 commit 2c86e15
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions backend/run/copr-backend-unknown-resalloc-tickets.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,19 @@ def print_once(message):
def _main():
script_requires_user("resalloc")

all_known = all_ids()
if not all_known:
print("no tickets taken")
return

used = used_ids()
if not used:
print("no tickets used")
return
print("no tickets used by copr-backend")

# This is the oldest ticket that Copr Backend currently uses.
min_used = min(used)
min_used = min(used) if used else 0

all_known = all_ids()
unknown = all_known - used

for unknown_id in sorted(unknown):
if unknown_id < min_used:
print_once("These are old tickets, Copr only uses newer tickets, close them:")
Expand Down

0 comments on commit 2c86e15

Please sign in to comment.