Skip to content

Commit fa142c0

Browse files
committed
fix to disable cloud option
1 parent 997a897 commit fa142c0

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

app.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ def wrapper(*args, **kwargs):
100100
# Use _cloud_job_id from payload if available (for cloud jobs), otherwise generate new UUID
101101
job_id = data.pop('_cloud_job_id', None) or str(uuid.uuid4())
102102

103-
# Extract disable_cloud_job from payload for conditional logic and remove it
104-
# to prevent validation errors in all processing modes
105-
disable_cloud_job = data.pop('disable_cloud_job', None)
106103

107104
pid = os.getpid() # Get PID for non-queued tasks
108105
start_time = time.time()
@@ -157,7 +154,7 @@ def wrapper(*args, **kwargs):
157154

158155
return response_obj, response[2]
159156

160-
if os.environ.get("GCP_JOB_NAME") and data.get("webhook_url") and not disable_cloud_job:
157+
if os.environ.get("GCP_JOB_NAME") and data.get("webhook_url") and not data.get("disable_cloud_job"):
161158
try:
162159
# Create enhanced payload with original job_id for cloud jobs
163160
cloud_payload = data.copy()

app_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ def decorated_function(*args, **kwargs):
3131
if not request.json:
3232
return jsonify({"message": "Missing JSON in request"}), 400
3333

34-
# Create a copy of the request data and remove internal _cloud_job_id field
35-
# to prevent validation errors while preserving it for cloud job processing
34+
# Create a copy of the request data and remove internal _cloud_job_id and disable_cloud_job fields
35+
# to prevent validation errors while preserving them for processing
3636
validation_data = request.json.copy()
3737
validation_data.pop('_cloud_job_id', None)
38+
validation_data.pop('disable_cloud_job', None)
3839

3940
try:
4041
jsonschema.validate(instance=validation_data, schema=schema)

0 commit comments

Comments
 (0)