From 42b567b3276410ed61271f7ac1806f16d8fafee1 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Oct 05 2017 20:15:23 +0000 Subject: clear message cache after sending --- diff --git a/plugins/hub/messagebus.py b/plugins/hub/messagebus.py index eb7e5fb..50ee98a 100644 --- a/plugins/hub/messagebus.py +++ b/plugins/hub/messagebus.py @@ -234,11 +234,16 @@ def prep_message(cbtype, *args, **kws): @callback('postCommit') @ignore_error def send_messages(cbtype, *args, **kws): - '''Send the cached message from the other callback''' + '''Send the messages cached by prep_message''' global config messages = getattr(context, 'messagebus_plugin_messages', []) + if not messages: + return sender = get_sender() for message in messages: sender.send(message, sync=True, timeout=config.getfloat('broker', 'timeout')) sender.close(timeout=config.getfloat('broker', 'timeout')) + + # koji should do this for us, but just in case... + del context.messagebus_plugin_messages