From b4d85087014639433a482c9869b1e6e9de11a330 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Oct 27 2021 12:25:09 +0000 Subject: Sleep for 1 minute between compose requests to ensure composes have different compose ids. Signed-off-by: Jan Kaluza --- diff --git a/cccc/cli.py b/cccc/cli.py index 65efe83..87d8832 100644 --- a/cccc/cli.py +++ b/cccc/cli.py @@ -8,6 +8,7 @@ import datetime import os import shutil import tempfile +import time def _url_split(url): @@ -191,6 +192,10 @@ def _create_composes(conf, default_commit, updated_commit): return None, None print("Compose ID: %d" % default_compose_id) + # Sleep 60 seconds to prevent the ODCS race condition when two same composes + # can get the same compose id if submitted at exactly same time. + time.sleep(60) + print("Requesting compose for updated configuration.") updated_compose_id = cccc.compose.request_compose(conf, updated_commit) if not updated_compose_id: