1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-23 23:38:21 +00:00

Handle a race condition at project closing

Fix #1015
This commit is contained in:
Julien Duponchelle 2017-05-05 19:39:06 +02:00
parent 3070a68273
commit 6870749e50
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -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)