make sure gc never iterate over a mutating dict
This commit is contained in:
parent
ace75fdd3d
commit
60e18c88f0
1 changed files with 1 additions and 1 deletions
2
nwcp.py
2
nwcp.py
|
|
@ -53,7 +53,7 @@ class MainSubscription:
|
|||
expire = expire or 1 * 60 * 60
|
||||
now = int(time.time())
|
||||
deleted_ids = []
|
||||
for [event_id, event] in self.events.items():
|
||||
for event_id, event in list(self.events.items()):
|
||||
if event_id in self.responses:
|
||||
if now - event["created_at"] > expire:
|
||||
del self.events[event_id]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue