Skip to content

Commit

Permalink
fix: added env values for gunicorn workers and threads in openfaas
Browse files Browse the repository at this point in the history
  • Loading branch information
abhimanyubabbar committed Jun 5, 2024
1 parent cd0b81b commit b3dc0f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/util/openfaas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`);
}
Expand Down

0 comments on commit b3dc0f1

Please sign in to comment.