mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-07-03 14:05:26 +02:00
Remove over-engineering: drop tree_queue setter, _set_connected(), fi… (#63)
…x cancel_all() TOCTOU - Remove tree_queue property setter (backward-compat hack; all callers already migrated to replace_tree_queue()); keep property getter only - Update 2 remaining tests that still used direct assignment to use replace_tree_queue() - Remove _set_connected() 1-line wrapper on DiscordPlatform; assign _connected directly - Fix cancel_all() TOCTOU: hold self._lock for the full loop so newly created trees cannot slip through between the snapshot and cancellation --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -314,11 +314,10 @@ class TreeQueueManager:
|
||||
"""Cancel all messages in all trees."""
|
||||
async with self._lock:
|
||||
root_ids = list(self._repository.tree_ids())
|
||||
|
||||
all_cancelled: list[MessageNode] = []
|
||||
for root_id in root_ids:
|
||||
all_cancelled.extend(await self.cancel_tree(root_id))
|
||||
return all_cancelled
|
||||
all_cancelled: list[MessageNode] = []
|
||||
for root_id in root_ids:
|
||||
all_cancelled.extend(await self.cancel_tree(root_id))
|
||||
return all_cancelled
|
||||
|
||||
def cleanup_stale_nodes(self) -> int:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user