|
|
@ -19,11 +19,13 @@ const xss = new XSS.FilterXSS({ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const Redis = require('redis'); |
|
|
|
const Redis = require('redis'); |
|
|
|
|
|
|
|
const RedisLRU = require('redis-lru'); |
|
|
|
const util = require('util'); |
|
|
|
const util = require('util'); |
|
|
|
const redis = Redis.createClient(process.argv[2]); |
|
|
|
const redis = Redis.createClient(process.argv[2]); |
|
|
|
|
|
|
|
const redisLru = RedisLRU(redis, parseInt(process.argv[3])); |
|
|
|
const redisCache = { |
|
|
|
const redisCache = { |
|
|
|
get: util.promisify(redis.get).bind(redis), |
|
|
|
get: redisLru.get.bind(redisLru), |
|
|
|
set: util.promisify(redis.set).bind(redis) |
|
|
|
set: redisLru.set.bind(redisLru) |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
async function highlight(code, lang) { |
|
|
|
async function highlight(code, lang) { |
|
|
|