index.jsView |
---|
23 | 23 … | var many = require('pull-many') |
24 | 24 … | var ident = require('pull-identify-filetype') |
25 | 25 … | var mime = require('mime-types') |
26 | 26 … | var moment = require('moment') |
| 27 … | +var LRUCache = require('lrucache') |
27 | 28 … | |
28 | 29 … | var hlCssPath = path.resolve(require.resolve('highlight.js'), '../../styles') |
29 | 30 … | var emojiPath = path.resolve(require.resolve('emoji-named-characters'), '../pngs') |
30 | 31 … | |
113 | 114 … | this.logLevel = this.logLevels.indexOf(config.logging.level) |
114 | 115 … | this.ssbAppname = config.appname || 'ssb' |
115 | 116 … | this.isPublic = config.public |
116 | 117 … | this.getVotes = require('./lib/votes')(ssb) |
117 | | - this.getMsg = asyncMemo(ssb.get) |
| 118 … | + this.getMsg = asyncMemo({cache: new LRUCache(100)}, ssb.get) |
118 | 119 … | this.issues = Issues.init(ssb) |
119 | 120 … | this.pullReqs = PullRequests.init(ssb) |
120 | | - this.getRepo = asyncMemo(function (id, cb) { |
| 121 … | + this.getRepo = asyncMemo({ |
| 122 … | + cache: new LRUCache(32) |
| 123 … | + }, function (id, cb) { |
121 | 124 … | this.getMsg(id, function (err, msg) { |
122 | 125 … | if (err) return cb(err) |
123 | 126 … | ssbGit.getRepo(ssb, {key: id, value: msg}, {live: true}, cb) |
124 | 127 … | }) |