File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/DIRAC/Resources/MessageQueue Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -200,10 +200,14 @@ def connect(self, parameters=None):
200200
201201 for _ in range (10 ):
202202 try :
203- # We need to explicitely call disconnect to avoid leaving
204- # threads behind
203+ # We need to explicitly call disconnect to avoid leaving threads behind
205204 self .connection .disconnect ()
206- self .connection .connect (username = user , passcode = password , wait = True )
205+
206+ # Connect to the broker with a timeout of 30 seconds
207+ self .connection .connect (username = user , passcode = password , wait = False )
208+ self .transport .wait_for_connection (30 ) # pylint: disable=no-member
209+ if self .transport .connection_error : # pylint: disable=no-member
210+ raise stomp .exception .ConnectFailedException ()
207211
208212 if self .connection .is_connected ():
209213 # Go to the socket of the Stomp to find the remote host
You can’t perform that action at this time.
0 commit comments