Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const _getChannel = (slug, page = 1, cb) => {
- const key = `channelpage-channel-${ slug }-${ page }`;
- client
- .getAsync(key)
- .then((result) => {
- if (result) return cb(null, JSON.parse(result));
- _requestChannelWithVideos(slug, page)
- .then((data) => {
- cb(null, data);
- client.set(key, JSON.stringify(data));
- client.expire(key, _redisExpire);
- })
- .catch(cb);
- })
- .catch(cb);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement