From fa688c5a784f234b0850e2b22cd667e755283fe1 Mon Sep 17 00:00:00 2001 From: PMazarovich <57707673+PMazarovich@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:59:45 +0300 Subject: [PATCH] Setup nuclio timeout (#6840) See these several issues. They are connected to each other in some way. The thing is that nuclio has a default timeout of 1 minute. With this change we can force nuclio dashboard not to terminate the connection. https://github.com/nuclio/nuclio/issues/3016 https://github.com/opencv/cvat/issues/3301 https://github.com/opencv/cvat/issues/6041 --- cvat/apps/lambda_manager/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cvat/apps/lambda_manager/views.py b/cvat/apps/lambda_manager/views.py index d76624ff4d18..8b8e4fbe2c92 100644 --- a/cvat/apps/lambda_manager/views.py +++ b/cvat/apps/lambda_manager/views.py @@ -62,14 +62,15 @@ def _http(self, method="get", scheme=None, host=None, port=None, host or settings.NUCLIO['HOST'], port or settings.NUCLIO['PORT']) NUCLIO_FUNCTION_NAMESPACE = function_namespace or settings.NUCLIO['FUNCTION_NAMESPACE'] + NUCLIO_TIMEOUT = settings.NUCLIO['DEFAULT_TIMEOUT'] extra_headers = { 'x-nuclio-project-name': 'cvat', 'x-nuclio-function-namespace': NUCLIO_FUNCTION_NAMESPACE, 'x-nuclio-invoke-via': 'domain-name', + 'X-Nuclio-Invoke-Timeout': f"{NUCLIO_TIMEOUT}s", } if headers: extra_headers.update(headers) - NUCLIO_TIMEOUT = settings.NUCLIO['DEFAULT_TIMEOUT'] if url: url = "{}{}".format(NUCLIO_GATEWAY, url)