From fd2b76e0781466139785d841d3f16c45688aad48 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jun 27 2022 14:33:47 +0000 Subject: proton: save messages when connection fails Fixes: https://pagure.io/koji/issue/3327 --- diff --git a/plugins/hub/protonmsg.py b/plugins/hub/protonmsg.py index 3b90a3f..4f7f279 100644 --- a/plugins/hub/protonmsg.py +++ b/plugins/hub/protonmsg.py @@ -323,8 +323,13 @@ def prep_repo_done(cbtype, *args, **kws): def _send_msgs(urls, msgs, CONFIG): random.shuffle(urls) for url in urls: - container = Container(TimeoutHandler(url, msgs, CONFIG)) - container.run() + try: + container = Container(TimeoutHandler(url, msgs, CONFIG)) + container.run() + except Exception as ex: + # It's ok if we don't send messages for any reason. We'll try again later. + LOG.debug(f'container setup error ({url}): {ex}') + if msgs: LOG.debug('could not send to %s, %s messages remaining', url, len(msgs))