Skip to content

Commit

Permalink
Added env variable for ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyomKa committed May 17, 2017
1 parent 40ad018 commit 07afea5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,5 @@ exports.profiles_api = {
username: process.env.DRUPAL_PROFILE_API_USER || 'dummy',
password: process.env.DRUPAL_PROFILE_API_PASSWORD || 'dummy',
useCache: process.env.USE_DRUPAL_CACHE || false,
cacheTTL: process.env.USE_DRUPAL_CACHE_TTL || 3600*24,
};
3 changes: 2 additions & 1 deletion libs/drupal_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const request = require('superagent');
const logger = require('../libs/logger')(module);
const drupalConfig = require('config').get('profiles_api');
const NodeCache = require("node-cache");
const drupalCache = new NodeCache({ stdTTL: 60*60*24, checkperiod: 600 });

const drupalCache = new NodeCache({ stdTTL: drupalConfig.cacheTTL, checkperiod: 600 });

function parseFromAnchorTag(uid_string) {
var re = /<a.*>(.+)<\/a>/g;
Expand Down

0 comments on commit 07afea5

Please sign in to comment.