diff --git a/src/util/customTransforrmationsStore.js b/src/util/customTransforrmationsStore.js index 46e2b9c9b5..08d417c07c 100644 --- a/src/util/customTransforrmationsStore.js +++ b/src/util/customTransforrmationsStore.js @@ -4,7 +4,7 @@ const logger = require('../logger'); const { responseStatusHandler } = require('./utils'); const stats = require('./stats'); -const myCache = new NodeCache(); +const myCache = new NodeCache({ stdTTL: 60 * 60 * 24 * 1 }); // const CONFIG_BACKEND_URL = "http://localhost:5000"; const CONFIG_BACKEND_URL = process.env.CONFIG_BACKEND_URL || 'https://api.rudderlabs.com'; diff --git a/src/util/eventValidation.js b/src/util/eventValidation.js index a920b9bde5..68d895dcc5 100644 --- a/src/util/eventValidation.js +++ b/src/util/eventValidation.js @@ -10,9 +10,10 @@ const hash = require('object-hash'); const logger = require('../logger'); const trackingPlan = require('./trackingPlan'); +const SECONDS_IN_DAY = 60 * 60 * 24 * 1; const eventSchemaCache = new NodeCache(); -const ajv19Cache = new NodeCache({ useClones: false }); -const ajv4Cache = new NodeCache({ useClones: false }); +const ajv19Cache = new NodeCache({ useClones: false, stdTTL: SECONDS_IN_DAY }); +const ajv4Cache = new NodeCache({ useClones: false, stdTTL: SECONDS_IN_DAY }); const { isEmptyObject } = require('../v0/util'); const defaultOptions = {