mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
refactor 6 month retention. use auth instead of cache:website
This commit is contained in:
parent
37b6194c5f
commit
741c6039e6
29 changed files with 43 additions and 48 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
import { uuid } from '@/lib/crypto';
|
||||
import redis from '@/lib/redis';
|
||||
import { fetchAccount } from '@/lib/load';
|
||||
import { getQueryFilters, parseRequest } from '@/lib/request';
|
||||
import { json, unauthorized } from '@/lib/response';
|
||||
import { pagingParams, searchParams } from '@/lib/schema';
|
||||
|
|
@ -52,7 +52,7 @@ export async function POST(request: Request) {
|
|||
const { id, name, domain, shareId, teamId } = body;
|
||||
|
||||
if (process.env.CLOUD_MODE && !teamId) {
|
||||
const account = await redis.client.get(`account:${auth.user.id}`);
|
||||
const account = await fetchAccount(auth.user.id);
|
||||
|
||||
if (!account?.hasSubscription) {
|
||||
const count = await getWebsiteCount(auth.user.id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue