mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Use Current ioloop in SyncWrapper
A new ioloop is created for each SyncWrapper, but is not swapped in automatically (see make_current=False for Tornado) anymore - this means that the context manager (current_ioloop) is needed to access that ioloop for the purposes of the synchronus execution. Signed-off-by: Joe Groocock <jgroocock@cloudflare.com>
This commit is contained in:
parent
f6db09f724
commit
dcf37bda37
1 changed files with 2 additions and 1 deletions
|
@ -63,7 +63,8 @@ class SyncWrapper:
|
|||
self.cls = cls
|
||||
if loop_kwarg:
|
||||
kwargs[self.loop_kwarg] = self.io_loop
|
||||
self.obj = cls(*args, **kwargs)
|
||||
with current_ioloop(self.io_loop):
|
||||
self.obj = cls(*args, **kwargs)
|
||||
self._async_methods = list(
|
||||
set(async_methods + getattr(self.obj, "async_methods", []))
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue