mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Honor timeouts when possible
This commit is contained in:
parent
a04fe85ffa
commit
dadacf2685
3 changed files with 4 additions and 5 deletions
|
@ -1475,7 +1475,7 @@ class TCPPublishServer(salt.transport.base.DaemonizedPublishServer):
|
|||
async def publish_payload(self, payload, *args):
|
||||
return await self.pub_server.publish_payload(payload)
|
||||
|
||||
def connect(self):
|
||||
def connect(self, timeout=None):
|
||||
self.pub_sock = salt.utils.asynchronous.SyncWrapper(
|
||||
_TCPPubServerPublisher,
|
||||
(
|
||||
|
@ -1485,7 +1485,7 @@ class TCPPublishServer(salt.transport.base.DaemonizedPublishServer):
|
|||
),
|
||||
loop_kwarg="io_loop",
|
||||
)
|
||||
self.pub_sock.connect()
|
||||
self.pub_sock.connect(timeout=timeout)
|
||||
|
||||
async def publish(self, payload, **kwargs):
|
||||
"""
|
||||
|
|
|
@ -976,7 +976,7 @@ class PublishServer(salt.transport.base.DaemonizedPublishServer):
|
|||
args=(self.publish_payload,),
|
||||
)
|
||||
|
||||
def connect(self):
|
||||
def connect(self, timeout=None):
|
||||
"""
|
||||
Create and connect this thread's zmq socket. If a publisher socket
|
||||
already exists "pub_close" is called before creating and connecting a
|
||||
|
|
|
@ -384,8 +384,7 @@ class SaltEvent:
|
|||
),
|
||||
)
|
||||
try:
|
||||
# self.pusher.connect(timeout=timeout)
|
||||
self.pusher.connect()
|
||||
self.pusher.connect(timeout=timeout)
|
||||
self.cpush = True
|
||||
except tornado.iostream.StreamClosedError as exc:
|
||||
log.debug("Unable to connect pusher: %s", exc)
|
||||
|
|
Loading…
Add table
Reference in a new issue