Revision b1bb9251 snf-cyclades-app/synnefo/logic/dispatcher.py
b/snf-cyclades-app/synnefo/logic/dispatcher.py | ||
---|---|---|
82 | 82 |
|
83 | 83 |
def wait(self): |
84 | 84 |
log.info("Waiting for messages..") |
85 |
timeout = 600 |
|
85 | 86 |
while True: |
86 | 87 |
try: |
87 | 88 |
# Close the Django DB connection before processing |
... | ... | |
90 | 91 |
# the dispatcher to recover from broken connections |
91 | 92 |
# gracefully. |
92 | 93 |
close_connection() |
93 |
self.client.basic_wait() |
|
94 |
msg = self.client.basic_wait(timeout=timeout) |
|
95 |
if not msg: |
|
96 |
log.warning("Idle connection for %d seconds. Will connect" |
|
97 |
" to a different host. Verify that" |
|
98 |
" snf-ganeti-eventd is running!!", timeout) |
|
99 |
self.client.reconnect() |
|
94 | 100 |
except SystemExit: |
95 | 101 |
break |
96 | 102 |
except Exception as e: |
Also available in: Unified diff