...
|
...
|
@@ -11,7 +11,7 @@ const Memcached = require('memcached'); |
|
|
const _ = require('lodash');
|
|
|
const config = require('../config/common');
|
|
|
|
|
|
let cache = new Memcached(config.memcached.server, config.memcached);
|
|
|
let cache = new Memcached(config.memcache.server, config.memcache);
|
|
|
|
|
|
cache = Promise.promisifyAll(cache);
|
|
|
|
...
|
...
|
@@ -49,9 +49,9 @@ exports.getMulti = (list) => { |
|
|
exports.set = (key, value, lifetime) => {
|
|
|
lifetime = lifetime || 3600;
|
|
|
|
|
|
if (_.isObject(value)) {
|
|
|
value = JSON.stringify(value);
|
|
|
}
|
|
|
// if (_.isObject(value)) {
|
|
|
// value = JSON.stringify(value);
|
|
|
// }
|
|
|
|
|
|
if (_.isString(key)) {
|
|
|
return cache.setAsync(key, value, lifetime);
|
...
|
...
|
|