zip_deploy: replace references to ioloop with eventloop
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
d52554231a
commit
912840bbcd
|
@ -14,8 +14,6 @@ import re
|
||||||
import time
|
import time
|
||||||
import tempfile
|
import tempfile
|
||||||
import zipfile
|
import zipfile
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
|
||||||
from tornado.ioloop import IOLoop
|
|
||||||
from .app_deploy import AppDeploy
|
from .app_deploy import AppDeploy
|
||||||
from utils import verify_source
|
from utils import verify_source
|
||||||
|
|
||||||
|
@ -87,9 +85,8 @@ class ZipDeploy(AppDeploy):
|
||||||
async def _parse_info_file(self, file_name: str) -> Dict[str, Any]:
|
async def _parse_info_file(self, file_name: str) -> Dict[str, Any]:
|
||||||
try:
|
try:
|
||||||
info_file = self.path.joinpath(file_name)
|
info_file = self.path.joinpath(file_name)
|
||||||
with ThreadPoolExecutor(max_workers=1) as tpe:
|
event_loop = self.server.get_event_loop()
|
||||||
info_bytes = await IOLoop.current().run_in_executor(
|
info_bytes = await event_loop.run_in_thread(info_file.read_text)
|
||||||
tpe, info_file.read_text)
|
|
||||||
info: Dict[str, Any] = json.loads(info_bytes)
|
info: Dict[str, Any] = json.loads(info_bytes)
|
||||||
except Exception:
|
except Exception:
|
||||||
self.log_exc(f"Unable to parse info file {file_name}")
|
self.log_exc(f"Unable to parse info file {file_name}")
|
||||||
|
@ -145,9 +142,8 @@ class ZipDeploy(AppDeploy):
|
||||||
f"Owner repo mismatch. Received {owner_repo}, "
|
f"Owner repo mismatch. Received {owner_repo}, "
|
||||||
f"official: {self.official_repo}")
|
f"official: {self.official_repo}")
|
||||||
# validate the local source code
|
# validate the local source code
|
||||||
with ThreadPoolExecutor(max_workers=1) as tpe:
|
event_loop = self.server.get_event_loop()
|
||||||
res = await IOLoop.current().run_in_executor(
|
res = await event_loop.run_in_thread(verify_source, self.path)
|
||||||
tpe, verify_source, self.path)
|
|
||||||
if res is not None:
|
if res is not None:
|
||||||
self.source_checksum, self.pristine = res
|
self.source_checksum, self.pristine = res
|
||||||
if self.name in ["moonraker", "klipper"]:
|
if self.name in ["moonraker", "klipper"]:
|
||||||
|
@ -369,9 +365,9 @@ class ZipDeploy(AppDeploy):
|
||||||
dl_url, temp_download_file, content_type, size)
|
dl_url, temp_download_file, content_type, size)
|
||||||
self.notify_status(
|
self.notify_status(
|
||||||
f"Download Complete, extracting release to '{self.path}'")
|
f"Download Complete, extracting release to '{self.path}'")
|
||||||
with ThreadPoolExecutor(max_workers=1) as tpe:
|
event_loop = self.server.get_event_loop()
|
||||||
await IOLoop.current().run_in_executor(
|
event_loop.run_in_thread(
|
||||||
tpe, self._extract_release, temp_download_file)
|
self._extract_release, temp_download_file)
|
||||||
await self._update_dependencies(npm_hash, force=force_dep_update)
|
await self._update_dependencies(npm_hash, force=force_dep_update)
|
||||||
await self._update_repo_state()
|
await self._update_repo_state()
|
||||||
await self.restart_service()
|
await self.restart_service()
|
||||||
|
|
Loading…
Reference in New Issue