Updated redis logic.

This commit is contained in:
Mike Cao committed 2025-02-10 21:07:18 -08:00
1 parent 39e7ceac06
commit 4d6ec631f7
9 files changed
+52 -46

No files matched your search

+3 -7
View File
@@ -1,5 +1,5 @@
import { Prisma, Website } from '@prisma/client';
import { getClient } from '@umami/redis-client';
import redis from '@/lib/redis';
import prisma from '@/lib/prisma';
import { PageResult, PageParams } from '@/lib/types';
import WebsiteFindManyArgs = Prisma.WebsiteFindManyArgs;
@@ -182,9 +182,7 @@ export async function resetWebsite(
}),
]).then(async data => {
if (cloudMode) {
const redis = getClient();
await redis.set(`website:${websiteId}`, data[3]);
await redis.client.set(`website:${websiteId}`, data[3]);
}
return data;
@@ -227,9 +225,7 @@ export async function deleteWebsite(
}),
]).then(async data => {
if (cloudMode) {
const redis = getClient();
await redis.del(`website:${websiteId}`);
await redis.client.del(`website:${websiteId}`);
}
return data;