File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments