Files
yawan-workbench/server/app/execution_config.py
T

19 lines
519 B
Python
Raw Normal View History

"""Execution backend selection.
inline: legacy mode; FastAPI spawns a local background thread.
dsh: workbench only creates CampaignRun/TaskQueueItem rows; an external DSH (default)
worker leases and executes the content production pipeline.
"""
from __future__ import annotations
import os
def execution_backend() -> str:
value = os.getenv("YAWAN_EXECUTION_BACKEND", "dsh").strip().lower()
return "dsh" if value == "dsh" else "inline"
def is_dsh_backend() -> bool:
return execution_backend() == "dsh"