Skip to content

Commit

Permalink
man
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Jul 16, 2023
1 parent 58ece4c commit 052d849
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default defineNuxtConfig({
devStorage: {
driver: 'memory',
},
redis: (() => (!process.env.NUXT_ENABLE_REDIS
redis: (() => (process.env.NUXT_ENABLE_REDIS
? {
driver: 'redis',
port: process.env.NUXT_REDIS_PORT,
Expand Down
4 changes: 1 addition & 3 deletions server/trpc/routers/me/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ export const meRouter = router({
get: protectedProcedure
.meta({ participants: true })
.query(async ({ ctx }) => {
if (await userStorage.hasItem(ctx.session.user.id)) {
console.log('cached from redis')
if (await userStorage.hasItem(ctx.session.user.id))
return await userStorage.getItem<User>(ctx.session.user.id)
}

const user = await ctx.prisma.user.findUniqueOrThrow({
where: { id: ctx.session.user.id },
Expand Down

0 comments on commit 052d849

Please sign in to comment.