mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Compute md5sum on thread and don't block main server, Ref. gui#2239
This commit is contained in:
parent
3c5ca9ce0e
commit
6868e20a70
@ -557,7 +557,7 @@ class BaseManager:
|
|||||||
f.write(packet)
|
f.write(packet)
|
||||||
os.chmod(tmp_path, stat.S_IWRITE | stat.S_IREAD | stat.S_IEXEC)
|
os.chmod(tmp_path, stat.S_IWRITE | stat.S_IREAD | stat.S_IEXEC)
|
||||||
shutil.move(tmp_path, path)
|
shutil.move(tmp_path, path)
|
||||||
md5sum(path)
|
yield from wait_run_in_executor(md5sum, path)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise aiohttp.web.HTTPConflict(text="Could not write image: {} because {}".format(filename, e))
|
raise aiohttp.web.HTTPConflict(text="Could not write image: {} because {}".format(filename, e))
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ import gns3server
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from gns3server.utils import parse_version
|
from gns3server.utils import parse_version
|
||||||
from gns3server.utils.asyncio import subprocess_check_output
|
from gns3server.utils.asyncio import subprocess_check_output, wait_run_in_executor
|
||||||
from .qemu_error import QemuError
|
from .qemu_error import QemuError
|
||||||
from ..adapters.ethernet_adapter import EthernetAdapter
|
from ..adapters.ethernet_adapter import EthernetAdapter
|
||||||
from ..nios.nio_udp import NIOUDP
|
from ..nios.nio_udp import NIOUDP
|
||||||
|
Loading…
Reference in New Issue
Block a user