Add env vars to make jobs take longer for visual interest

This commit is contained in:
Stuart Axelbrooke 2025-07-17 23:30:45 -07:00
parent d245581b7d
commit d5ece9ac56
6 changed files with 12 additions and 0 deletions

View file

@ -70,6 +70,8 @@ def handle_config(args):
print(json.dumps(config))
def handle_exec(args):
import time, random, os; time.sleep(float(os.getenv('EXEC_SLEEP', '0')) * random.random())
if len(args) < 2:
print("Exec mode requires category and date arguments", file=sys.stderr)
sys.exit(1)

View file

@ -70,6 +70,8 @@ def handle_config(args):
print(json.dumps(config))
def handle_exec(args):
import time, random, os; time.sleep(float(os.getenv('EXEC_SLEEP', '0')) * random.random())
if len(args) < 2:
print("Exec mode requires category and date arguments", file=sys.stderr)
sys.exit(1)

View file

@ -65,6 +65,8 @@ def handle_config(args):
print(json.dumps(config))
def handle_exec(args):
import time, random, os; time.sleep(float(os.getenv('EXEC_SLEEP', '0')) * random.random())
# Write debug info to a file since stdout might not be captured
debug_file = "/tmp/databuild_test/podcasts_debug.log"
with open(debug_file, "w") as f:

View file

@ -77,6 +77,8 @@ def handle_config(args):
print(json.dumps(config))
def handle_exec(args):
import time, random, os; time.sleep(float(os.getenv('EXEC_SLEEP', '0')) * random.random())
if len(args) < 1:
print("Exec mode requires date argument", file=sys.stderr)
sys.exit(1)

View file

@ -70,6 +70,8 @@ def handle_config(args):
print(json.dumps(config))
def handle_exec(args):
import time, random, os; time.sleep(float(os.getenv('EXEC_SLEEP', '0')) * random.random())
if len(args) < 2:
print("Exec mode requires category and date arguments", file=sys.stderr)
sys.exit(1)

View file

@ -70,6 +70,8 @@ def handle_config(args):
print(json.dumps(config))
def handle_exec(args):
import time, random, os; time.sleep(float(os.getenv('EXEC_SLEEP', '0')) * random.random())
if len(args) < 2:
print("Exec mode requires category and date arguments", file=sys.stderr)
sys.exit(1)