Skip to content

Commit 988b36f

Browse files
committed
handle broken connection separately
1 parent 755157e commit 988b36f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

varys/producer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ def run(self):
105105
except Exception:
106106
self._log.exception("Producer caught exception:")
107107

108-
if self._stopping or self._reconnect_wait < 0:
108+
if self._stopping:
109109
self._connection.process_data_events(time_limit=0)
110110
break
111+
elif self._reconnect_wait < 0:
112+
# connection has been broken but we don't want to reconnect
113+
# so there's no connection with data events to process
114+
break
111115
else:
112116
time.sleep(self._reconnect_wait)
113117
continue

0 commit comments

Comments
 (0)