Commit 150c7384 authored by Ziirish's avatar Ziirish

bump trio version

parent 66e9378d
Pipeline #1667 passed with stages
in 11 minutes and 19 seconds
......@@ -184,7 +184,7 @@ class BUIAgent(BUIbackend):
wrap = partial(getattr(parser, j['method']), **j['args'])
else:
wrap = getattr(parser, j['method'])
temp = await trio.run_sync_in_worker_thread(wrap)
temp = await trio.to_thread.run_sync(wrap)
res = json.dumps(temp)
elif j['func'] == 'agent_version':
res = json.dumps(__version__)
......@@ -193,7 +193,7 @@ class BUIAgent(BUIbackend):
if self.client.is_async:
res, err = await wrap()
else:
res, err = await trio.run_sync_in_worker_thread(wrap)
res, err = await trio.to_thread.run_sync(wrap)
if err:
await server_stream.send_all(b'ER')
await server_stream.send_all(struct.pack('!Q', len(err)))
......@@ -285,12 +285,12 @@ class BUIAgent(BUIbackend):
if self.client.is_async:
res = json.dumps(await wrap())
else:
res = json.dumps(await trio.run_sync_in_worker_thread(wrap))
res = json.dumps(await trio.to_thread.run_sync(wrap))
else:
if self.client.is_async:
res = json.dumps(await callback())
else:
res = json.dumps(await trio.run_sync_in_worker_thread(callback))
res = json.dumps(await trio.to_thread.run_sync(callback))
self.logger.info(f'result: {res}')
await server_stream.send_all(b'OK')
except (BUIserverException, Exception) as exc:
......
......@@ -227,7 +227,7 @@ class MonitorPool:
else:
async with self.get_mon(ident) as mon:
wrap = partial(mon.status, query, timeout=self.timeout, cache=False, raw=True)
response = await trio.run_sync_in_worker_thread(wrap)
response = await trio.to_thread.run_sync(wrap)
if cache:
self._status_cache[query] = response
......@@ -273,7 +273,7 @@ class MonitorPool:
return
mon = Monitor(self.burpbin, self.bconfcli, timeout=self.timeout, ident=id)
# warm up monitor
await trio.run_sync_in_worker_thread(mon.status)
await trio.to_thread.run_sync(mon.status)
await self.pool.put(mon)
except (BUIserverException, OSError):
pass
......
......@@ -816,7 +816,7 @@ class Burp(Burp2):
async def _async_restore_files(self, name=None, backup=None, files=None, strip=None,
archive='zip', password=None, agent=None):
return await trio.run_sync_in_worker_thread(Burp2.restore_files, self, name, backup, files, strip, archive, password, agent)
return await trio.to_thread.run_sync(Burp2.restore_files, self, name, backup, files, strip, archive, password, agent)
@usetriorun
def restore_files(self, name=None, backup=None, files=None, strip=None,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment