From b3dc0f14916a8a3798a3d024aba590434a510043 Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Fri, 1 Mar 2024 11:52:43 +0530 Subject: [PATCH] fix: added env values for gunicorn workers and threads in openfaas --- src/util/openfaas/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/openfaas/index.js b/src/util/openfaas/index.js index c0369deb81..2bb165a371 100644 --- a/src/util/openfaas/index.js +++ b/src/util/openfaas/index.js @@ -17,6 +17,8 @@ const FAAS_SCALE_TARGET = process.env.FAAS_SCALE_TARGET || '4'; const FAAS_SCALE_TARGET_PROPORTION = process.env.FAAS_SCALE_TARGET_PROPORTION || '0.70'; const FAAS_SCALE_ZERO = process.env.FAAS_SCALE_ZERO || 'false'; const FAAS_SCALE_ZERO_DURATION = process.env.FAAS_SCALE_ZERO_DURATION || '15m'; +const FAAS_GUNICORN_WORKERS = process.env.FAAS_GUNICORN_WORKERS || '1'; +const FAAS_GUNICORN_THREADS = process.env.FAAS_GUNICORN_THREADS || '1'; const FAAS_BASE_IMG = process.env.FAAS_BASE_IMG || 'rudderlabs/openfaas-flask:main'; const FAAS_MAX_PODS_IN_TEXT = process.env.FAAS_MAX_PODS_IN_TEXT || '40'; const FAAS_MIN_PODS_IN_TEXT = process.env.FAAS_MIN_PODS_IN_TEXT || '1'; @@ -147,6 +149,7 @@ const updateFaasFunction = async ( await updateFunction(functionName, payload); // wait for function to be ready and then set it in cache await awaitFunctionReadiness(functionName); + // set the function in cache setFunctionInCache(functionName); } catch (error) { // 404 is statuscode returned from openfaas community edition @@ -342,7 +345,6 @@ const executeFaasFunction = async ( if (error.statusCode === 404 && error.message.includes(`error finding function ${name}`)) { removeFunctionFromCache(name); - await setupFaasFunction(name, null, versionId, libraryVersionIDs, testMode, trMetadata); throw new RetryRequestError(`${name} not found`); }