proton: save messages when connection fails

Fixes: https://pagure.io/koji/issue/3327
This commit is contained in:
Tomas Kopecek 2022-05-12 14:00:14 +02:00
parent ecc485c627
commit 1ca5db555a

View file

@ -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))