We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b9dd91 commit e4cbff3Copy full SHA for e4cbff3
src/py/kaleido/kaleido.py
@@ -34,10 +34,10 @@
34
_stepper = False
35
36
37
-def _to_thread(func, *args, **kwargs):
+async def _to_thread(func, *args, **kwargs):
38
_loop = asyncio.get_running_loop()
39
fn = partial(func, *args, **kwargs)
40
- _loop.run_in_executor(None, fn)
+ await _loop.run_in_executor(None, fn)
41
42
43
# this is kinda public but undocumented
@@ -376,7 +376,7 @@ def write_image(binary):
376
file.write(binary)
377
378
_logger.info(f"Starting write of {full_path.name}")
379
- _to_thread(write_image, img)
+ await _to_thread(write_image, img)
380
_logger.info(f"Wrote {full_path.name}")
381
if profiler is not None:
382
self._finish_profile(profile, e, full_path.stat().st_size / 1000000)
0 commit comments