From c2101df92b7aed9c12f25d401decdb49fa73057e Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 31 Oct 2016 09:06:43 -0400 Subject: [PATCH] Add comment explaining what's going on here. --- module_build_service/scheduler/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module_build_service/scheduler/main.py b/module_build_service/scheduler/main.py index a8a82d0f..cec78dc9 100644 --- a/module_build_service/scheduler/main.py +++ b/module_build_service/scheduler/main.py @@ -159,6 +159,13 @@ class MessageWorker(threading.Thread): log.info("Calling %s" % idx) further_work = handler(conf, session, msg) or [] log.info("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_work_queue.put(event)