Selaa lähdekoodia

celeryev crashed when terminal is resized. Closes #160.

Ask Solem 14 vuotta sitten
vanhempi
commit
0852fe8b5c
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      celery/events/__init__.py

+ 7 - 1
celery/events/__init__.py

@@ -132,7 +132,13 @@ class EventReceiver(object):
             for iteration in count(0):
                 if limit and iteration > limit:
                     break
-                consumer.connection.drain_events(timeout=timeout)
+                try:
+                    consumer.connection.drain_events(timeout=timeout)
+                except socket.timeout:
+                    if timeout:
+                        raise
+                except socket.error:
+                    pass
         finally:
             consumer.close()