1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-18 21:09:41 +02:00
This commit is contained in:
didier 2025-04-09 15:39:35 +02:00
parent 44cb9588fc
commit e8d3b7f682

View file

@ -809,6 +809,23 @@ def move_to_script_folder():
# --------------------------------------
def get_enabled_workers():
config_dir = Path("~/pandora/pandora/workers")
yml_files = list(config_dir.glob("*.yml"))
return [str(file.stem) for file in yml_files if file.stem is not None]
def wait_for_workers():
pandora = pypandora.PyPandora(root_url=pandora_root_url)
target_count = len(get_enabled_workers()) - 1
while True:
workers = pandora.get_enabled_workers()
log(f"Workers ready : {len(workers)}/ {target_count}")
if len(workers) >= target_count:
break
time.sleep(2)
# --------------------------------------
def startup():
"""Start Pandora-box"""
@ -827,6 +844,9 @@ def startup():
# Print logo screen
print_screen()
# Wait for workers
wait_for_workers()
return "WAIT"
@ -876,23 +896,6 @@ def get_lock(process_name):
# --------------------------------------
def get_enabled_workers():
config_dir = Path("~/pandora/pandora/workers")
yml_files = list(config_dir.glob("*.yml"))
return [str(file.stem) for file in yml_files if file.stem is not None]
def wait_for_workers():
pandora = pypandora.PyPandora(root_url=pandora_root_url)
target_count = len(get_enabled_workers()) - 1
while True:
workers = pandora.get_enabled_workers()
log(f"Workers ready : {len(workers)}/ {target_count}")
if len(workers) >= target_count:
break
time.sleep(2)
# --------------------------------------
def main(_):
"""Main entry point"""
print("main")