From 58a058e7788e1fc1255903ac6b50251c203ad140 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Feb 07 2020 10:02:18 +0000 Subject: Fix handle of further works Signed-off-by: Chenxiong Qi --- diff --git a/freshmaker/consumer.py b/freshmaker/consumer.py index 55b74e4..16606d4 100644 --- a/freshmaker/consumer.py +++ b/freshmaker/consumer.py @@ -161,19 +161,20 @@ class FreshmakerConsumer(fedmsg.consumers.FedmsgConsumer): except Exception: err = 'Could not process message handler. See the traceback.' log.exception(err) + else: + # Handlers can *optionally* return a list of fake messages that + # should be re-inserted back into the main work queue. We can + # use this (for instance) when we submit a new component build + # but (for some reason) it has already been built, then it can + # fake its own completion back to the scheduler so that work + # resumes as if it was submitted for real and koji announced + # its completion. + for event in further_work: + log.info(" Scheduling faked event %r" % event) + self.incoming.put(event) log.debug("Done with %s" % idx) - # Handlers can *optionally* return a list of fake messages that - # should be re-inserted back into the main work queue. We can use - # this (for instance) when we submit a new component build but (for - # some reason) it has already been built, then it can fake its own - # completion back to the scheduler so that work resumes as if it - # was submitted for real and koji announced its completion. - for event in further_work: - log.info(" Scheduling faked event %r" % event) - self.incoming.put(event) - def get_global_consumer(): """ Return a handle to the active consumer object, if it exists. """