mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 20:40:13 +03:00
Ignore HTTPException received when closing a project
This commit is contained in:
parent
0d1341b4e0
commit
cb18b60c5d
@ -15,7 +15,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
import re
|
||||
import os
|
||||
import json
|
||||
@ -30,6 +29,7 @@ import zipfile
|
||||
import pathlib
|
||||
|
||||
from uuid import UUID, uuid4
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
from .node import Node
|
||||
from .compute import ComputeError
|
||||
@ -837,7 +837,11 @@ class Project:
|
||||
log.warning(f"Closing project '{self.name}' ignored because it is being loaded")
|
||||
return
|
||||
self._closing = True
|
||||
await self.stop_all()
|
||||
try:
|
||||
await self.stop_all()
|
||||
except HTTPException as e:
|
||||
if not e.status_code == status.HTTP_405_METHOD_NOT_ALLOWED:
|
||||
raise
|
||||
for compute in list(self._project_created_on_compute):
|
||||
try:
|
||||
await compute.post(f"/projects/{self._id}/close", dont_connect=True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user