Add a sleep in the init handler to protect against a race condition

This commit is contained in:
mprahl
2017-10-12 17:13:03 -04:00
parent 28470ec46c
commit a9bf4e9727

View File

@@ -41,6 +41,7 @@ import koji
import logging
import os
import time
logging.basicConfig(level=logging.DEBUG)
@@ -126,6 +127,9 @@ def done(config, session, msg):
def init(config, session, msg):
""" Called whenever a module enters the 'init' state."""
# Sleep for a few seconds to make sure the module in the database is committed
# TODO: Remove this once messaging is implemented in SQLAlchemy hooks
time.sleep(3)
build = models.ModuleBuild.from_module_event(session, msg)
try: