Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
auto_delete the queue, closes #236
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffbryner committed Feb 3, 2015
1 parent 3e5647a commit 51061c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bot/mozdefbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def alertsCallback(self, ch, method, properties, bodyin):

# delay ourselves so as not to overrun IRC receiveQ?
if abs(toUTC(datetime.now()) - toUTC(self.lastalert)).seconds < 2:
sleep(2)
sleep(4)

# see where we send this alert
ircchannel = options.alertircchannel
Expand Down Expand Up @@ -218,8 +218,11 @@ def openMQ(self):
if self.channel is None:
self.channel = self.connection.channel()
self.channel.exchange_declare(
exchange=options.alertexchange, type='topic', durable=True)
result = self.channel.queue_declare(exclusive=False)
exchange=options.alertexchange,
type='topic',
durable=True)
result = self.channel.queue_declare(exclusive=False,
auto_delete=True )
queue_name = result.method.queue
self.channel.queue_bind(
exchange=options.alertexchange,
Expand Down

0 comments on commit 51061c9

Please sign in to comment.