Skip to content

Commit

Permalink
chore: add ttl values for cache (#2593)
Browse files Browse the repository at this point in the history
  • Loading branch information
sivashanmukh authored Sep 21, 2023
1 parent fd6698e commit 70bdce8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/util/customTransforrmationsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
5 changes: 3 additions & 2 deletions src/util/eventValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 70bdce8

Please sign in to comment.