Browse Source

Cache the last 1000 most recently used API requests in memory

pull/15/merge
Luke Childs 7 years ago
parent
commit
82d0799a35
  1. 4
      lib/tor.js
  2. 3
      package.json

4
lib/tor.js

@ -1,6 +1,8 @@
const Onionoo = require('onionoo');
const QuickLRU = require('quick-lru');
const onionoo = new Onionoo();
const lru = new QuickLRU({ maxSize: 1000 });
const onionoo = new Onionoo({ cache: lru });
const setNodeType = type => node => {
node.type = type;

3
package.json

@ -17,7 +17,8 @@
"moment": "2.19.3",
"nunjucks": "3.0.1",
"onionoo": "2.0.1",
"pretty-bytes": "4.0.2"
"pretty-bytes": "4.0.2",
"quick-lru": "^1.1.0"
},
"devDependencies": {
"nodemon": "^1.10.2",

Loading…
Cancel
Save