1.0.0 • Published 4 years ago
redis-cacher-fg v1.0.0
说明:以给getShops接口加缓存为例
要点:executor为一个返回promise的函数
使用方式: const RedisCacher = require('redis-cacher-fg'); const cache = RedisCacher() const payload = { key: 'cacheKey', executor: cacheFuc.bind(null, 1), expire: 100 };
cache.get(payload)
.then((data) => {
// function return result
})
.catch((err) => {
// handle terror
});
1.0.0
4 years ago