CC-4915: Media-Monitor cannot handle rabbitmq restart event
-fixed
This commit is contained in:
parent
764ee0389f
commit
259f70bc21
2 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@ import socket
|
|||
import time
|
||||
from media.monitor.log import Loggable
|
||||
from media.monitor.toucher import RepeatTimer
|
||||
from amqplib.client_0_8.exceptions import AMQPConnectionException
|
||||
|
||||
class EventDrainer(Loggable):
|
||||
"""
|
||||
|
@ -14,7 +15,7 @@ class EventDrainer(Loggable):
|
|||
message = airtime_notifier.simple_queue.get(block=True)
|
||||
airtime_notifier.handle_message(message.payload)
|
||||
message.ack()
|
||||
except (IOError, AttributeError), e:
|
||||
except (IOError, AttributeError, AMQPConnectionException), e:
|
||||
self.logger.error('Exception: %s', e)
|
||||
while not airtime_notifier.init_rabbit_mq():
|
||||
self.logger.error("Error connecting to RabbitMQ Server. \
|
||||
|
|
|
@ -10,6 +10,7 @@ import time
|
|||
from kombu.connection import BrokerConnection
|
||||
from kombu.messaging import Exchange, Queue
|
||||
from kombu.simple import SimpleQueue
|
||||
from amqplib.client_0_8.exceptions import AMQPConnectionException
|
||||
import json
|
||||
|
||||
from std_err_override import LogWriter
|
||||
|
@ -112,7 +113,7 @@ class PypoMessageHandler(Thread):
|
|||
self.handle_message(message.payload)
|
||||
# ACK the message to take it off the queue
|
||||
message.ack()
|
||||
except (IOError, AttributeError), e:
|
||||
except (IOError, AttributeError, AMQPConnectionException), e:
|
||||
self.logger.error('Exception: %s', e)
|
||||
self.logger.error("traceback: %s", traceback.format_exc())
|
||||
while not self.init_rabbit_mq():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue