Skip to content

Commit

Permalink
Apply other suggestions from review
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 committed Mar 3, 2023
1 parent 2c06466 commit b0ae13e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
minor: [7, 8, 9, 11]
minor: [8, 9, 10, 11]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
Expand Down
6 changes: 3 additions & 3 deletions karton/system/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ def gc_collect_tasks(self) -> None:
current_time = time.time()
to_delete = []

queues_to_remove = set()
queues_to_clear = set()
online_consumers = self.backend.get_online_consumers()
for bind in self.backend.get_binds():
identity = bind.identity
if identity not in online_consumers and not bind.persistent:
# If offline and not persistent: mark queue to be removed
queues_to_remove.add(identity)
queues_to_clear.add(identity)
self.log.info("Non-persistent: removing bind %s", identity)
self.backend.unregister_bind(identity)
self.backend.delete_consumer_queues(identity)

for task in self.backend.iter_all_tasks(parse_resources=False):
root_tasks.add(task.root_uid)
if task.headers.get("receiver") in queues_to_remove:
if task.headers.get("receiver") in queues_to_clear:
to_delete.append(task)
self.log.info(
"Task %s is abandoned by inactive non-persistent consumer."
Expand Down

0 comments on commit b0ae13e

Please sign in to comment.