Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support explicit ttl #93

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
10 changes: 10 additions & 0 deletions apikeys/index.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,11 @@ var url = require("url");
var rs = require("jsrsasign");
var fs = require("fs");
var path = require("path");
<<<<<<< HEAD
const memoredpath = path.resolve(__dirname,'../../..')+'/third_party/memored/memored';
=======
const memoredpath = '../third_party/memored/index';
>>>>>>> 7d0c3c0
var cache = require(memoredpath);
var JWS = rs.jws.JWS;
var requestLib = require("request");
@@ -39,9 +43,15 @@ module.exports.init = function(config, logger, stats) {
//cache api keys
cacheKey = config.hasOwnProperty("cacheKey") ? config.cacheKey : false;
//cache ttl
<<<<<<< HEAD
cacheKeyTTL = config.hasOwnProperty("cacheKeyTTL") ? config.cacheKeyTTL : cacheKeyTTL;
//cache size
cacheSize = config.hasOwnProperty("cacheSize") ? config.cacheSize : cacheSize;
=======
cacheKeyTTL = config.hasOwnProperty("cacheKeyTTL") ? config.cacheKeyTTL : 60000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't respect the default cacheKeyTTL value prev set on line 25 - avoid magic numbers. same for cacheSize

//cache size
cacheSize = config.hasOwnProperty("cacheSize") ? config.cacheSize : 100;
>>>>>>> 7d0c3c0
//set grace period
var gracePeriod = config.hasOwnProperty("gracePeriod") ? config.gracePeriod : 0;
acceptField.gracePeriod = gracePeriod;
5 changes: 5 additions & 0 deletions monitor/index.js
Original file line number Diff line number Diff line change
@@ -4,8 +4,13 @@
*/

var debug = require('debug')('plugin:monitor');
<<<<<<< HEAD
var path = require("path");
const memoredpath = path.resolve(__dirname,'../../..')+'/third_party/memored/memored';
=======
// var path = require('path');
const memoredpath = '../third_party/memored/index';
>>>>>>> 7d0c3c0
var cache = require(memoredpath);
const lynx = require('lynx');
const os = require('os');
Loading