Handle a race condition at project closing

Fix #1015
pull/1027/head
Julien Duponchelle 7 years ago
parent 3070a68273
commit 6870749e50
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

@ -112,7 +112,10 @@ class ProjectHandler:
if ProjectHandler._notifications_listening.setdefault(project.id, 0) <= 1:
yield from project.close()
pm.remove_project(project.id)
del ProjectHandler._notifications_listening[project.id]
try:
del ProjectHandler._notifications_listening[project.id]
except KeyError:
pass
else:
log.warning("Skip project closing, another client is listening for project notifications")
response.set_status(204)

Loading…
Cancel
Save