Commit 5d41b663 authored by guang.wu's avatar guang.wu

feat: redis日志打印

parent a804e4ed
...@@ -11,11 +11,13 @@ export default class ActivityController extends Controller { ...@@ -11,11 +11,13 @@ export default class ActivityController extends Controller {
} else { } else {
const redisKey = `quantum-blocks:page:${ctx.params.id}`; const redisKey = `quantum-blocks:page:${ctx.params.id}`;
body = await ctx.service.redis.get(redisKey); body = await ctx.service.redis.get(redisKey);
console.log('quantum-blocks body :>> ', body);
if (body) { if (body) {
ctx.logger.info('请求redis成功 key: %j', redisKey); ctx.logger.info('请求redis成功 key: %j', redisKey);
} }
if (!body) { if (!body) {
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo }); body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
console.log('body2 :>> ', body);
await ctx.service.redis.set(redisKey, body); await ctx.service.redis.set(redisKey, body);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment