Added More Database Caching

This commit is contained in:
Ahmad 2024-04-21 15:52:10 -04:00
parent d30d95668e
commit 629998823e
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF

View file

@ -58,6 +58,7 @@ export const hasAvailableCount = async () => {
const orgLimit = await db.orgLimit.findUnique({ const orgLimit = await db.orgLimit.findUnique({
where: { orgId }, where: { orgId },
cacheStrategy: { ttl: 30, swr: 60 },
}); });
if (!orgLimit || orgLimit.count < MAX_FREE_BOARDS) { if (!orgLimit || orgLimit.count < MAX_FREE_BOARDS) {
@ -76,6 +77,7 @@ export const getAvailableCount = async () => {
const orgLimit = await db.orgLimit.findUnique({ const orgLimit = await db.orgLimit.findUnique({
where: { orgId }, where: { orgId },
cacheStrategy: { ttl: 30, swr: 60 },
}); });
if (!orgLimit) { if (!orgLimit) {