Skip to content

Commit 13895f6

Browse files
committed
fixes disable_cloud_job
1 parent fbe4db2 commit 13895f6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

app.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,14 @@ def wrapper(*args, **kwargs):
154154

155155
return response_obj, response[2]
156156

157-
if os.environ.get("GCP_JOB_NAME") and data.get("webhook_url") and not data.get("disable_cloud_job"):
157+
# Check if cloud job should be disabled (env var or payload)
158+
disable_by_env = os.environ.get("DISABLE_CLOUD_JOB", "").lower() in ["true", "1"]
159+
disable_cloud = (
160+
(disable_by_env and data.get("disable_cloud_job") is not False) or # Env disabled, not overridden by false
161+
data.get("disable_cloud_job") is True # Explicitly disabled in payload
162+
)
163+
164+
if os.environ.get("GCP_JOB_NAME") and data.get("webhook_url") and not disable_cloud:
158165
try:
159166
# Create enhanced payload with original job_id for cloud jobs
160167
cloud_payload = data.copy()

0 commit comments

Comments
 (0)