diff --git a/shuffle-ai/1.0.0/src/app.py b/shuffle-ai/1.0.0/src/app.py index 9bcff4a2..89925445 100644 --- a/shuffle-ai/1.0.0/src/app.py +++ b/shuffle-ai/1.0.0/src/app.py @@ -290,6 +290,25 @@ def run_schemaless(self, category, action, app_name="", fields=""): headers=headers, ) + try: + self.logger.info("Starting url checker") + if "parameters" in self.action: + response_headers = request.headers + for key, value in response_headers.items(): + if not str(key).lower().endswith("-url"): + continue + + self.action["parameters"].append({ + "name": key, + "value": value, + }) + + self.logger.info("[DEBUG] Response header: %s: %s" % (key, value)) + else: + self.logger.info("[DEBUG] No parameters in action. Can't append url headers.") + except Exception as e: + self.logger.info("[ERROR] Failed to get response headers: %s" % e) + try: return request.json() except: diff --git a/shuffle-ai/1.0.0/upload.sh b/shuffle-ai/1.0.0/upload.sh index 6dbdff4d..e5a55fb5 100755 --- a/shuffle-ai/1.0.0/upload.sh +++ b/shuffle-ai/1.0.0/upload.sh @@ -2,5 +2,5 @@ gcloud run deploy shuffle-ai-1-0-0 \ --region=europe-west2 \ --max-instances=5 \ - --set-env-vars=SHUFFLE_APP_EXPOSED_PORT=8080,SHUFFLE_SWARM_CONFIG=run,SHUFFLE_LOGS_DISABLED=true --source=./ \ - --timeout=300s + --set-env-vars=SHUFFLE_APP_EXPOSED_PORT=8080,SHUFFLE_SWARM_CONFIG=run,SHUFFLE_LOGS_DISABLED=true,SHUFFLE_APP_SDK_TIMEOUT=120 --source=./ \ + --timeout=120s