proxy support (--proxy/TREG_PROXY: browser+API same exit), multi-worker chainer (WAIT=0/TAG/BOOT_DELAY)

This commit is contained in:
Vlad Gothbreach
2026-10-16 11:26:35 +03:00
parent b08b86e0fb
commit 8b8c2845ac
3 changed files with 18 additions and 5 deletions
+7 -2
View File
@@ -10,6 +10,9 @@ HERE = os.path.dirname(os.path.abspath(__file__))
PY = sys.executable
N = os.environ.get("N", "50")
PACE = os.environ.get("PACE", "40")
WAIT = os.environ.get("WAIT", "1") == "1" # WAIT=0 -> unconditional waves (multi-worker)
TAG = os.environ.get("TAG", "")
BOOT_DELAY = int(os.environ.get("BOOT_DELAY", "0")) # stagger start, seconds
def wave_running():
@@ -38,9 +41,11 @@ def log(msg):
def main():
log("chainer start (N=%s PACE=%s)" % (N, PACE))
log("chainer%s start (N=%s PACE=%s WAIT=%d boot_delay=%ds)" % (TAG, N, PACE, WAIT, BOOT_DELAY))
if BOOT_DELAY:
time.sleep(BOOT_DELAY)
while True:
if wave_running():
if WAIT and wave_running():
log("wave already running — waiting 60s")
time.sleep(60)
continue