Merge branch 'dev'

This commit is contained in:
Atridad Lahiji 2023-08-09 13:01:52 -06:00
commit 458ba36c8d
No known key found for this signature in database
GPG key ID: 7CB8245F56BC3880
5 changed files with 8 additions and 8 deletions

View file

@ -25,14 +25,14 @@ export const restRouter = createTRPCRouter({
.input(z.void())
.output(z.number())
.query(async ({ ctx }) => {
const cachedResult = await fetchCache<number>(`kv_votecount_admin`);
const cachedResult = await fetchCache<number>(`kv_votecount`);
if (cachedResult) {
return cachedResult;
} else {
const votesCount = await ctx.prisma.vote.count();
await setCache(`kv_votecount_admin`, votesCount);
await setCache(`kv_votecount`, votesCount);
return votesCount;
}

View file

@ -25,7 +25,7 @@ export const roomRouter = createTRPCRouter({
},
});
if (room) {
await invalidateCache(`kv_roomcount_admin`);
await invalidateCache(`kv_roomcount`);
await invalidateCache(`kv_roomlist_${ctx.session.user.id}`);
await publishToChannel(
@ -215,8 +215,8 @@ export const roomRouter = createTRPCRouter({
});
if (deletedRoom) {
await invalidateCache(`kv_roomcount_admin`);
await invalidateCache(`kv_votecount_admin`);
await invalidateCache(`kv_roomcount`);
await invalidateCache(`kv_votecount`);
await invalidateCache(`kv_roomlist_${ctx.session.user.id}`);
await publishToChannel(

View file

@ -118,7 +118,7 @@ export const userRouter = createTRPCRouter({
react: Goodbye({ name: user.name }),
});
await invalidateCache(`kv_usercount_admin`);
await invalidateCache(`kv_usercount`);
await invalidateCache(`kv_userlist_admin`);
await publishToChannel(

View file

@ -85,7 +85,7 @@ export const voteRouter = createTRPCRouter({
});
if (vote) {
await invalidateCache(`kv_votecount_admin`);
await invalidateCache(`kv_votecount`);
await invalidateCache(`kv_votes_${input.roomId}`);
await publishToChannel(

View file

@ -66,7 +66,7 @@ export const authOptions: NextAuthOptions = {
react: Welcome({ name: user.name }),
});
await invalidateCache(`kv_userlist_admin`);
await invalidateCache(`kv_usercount_admin`);
await invalidateCache(`kv_usercount`);
await publishToChannel(
`stats`,