'
This commit is contained in:
@@ -16,27 +16,22 @@ type PayjsVipResult = {
|
||||
};
|
||||
|
||||
const inflightUserChecks = new Map<string, Promise<PayjsVipResult | null>>();
|
||||
type UserCheckPayload = {
|
||||
ok: boolean;
|
||||
vip: boolean;
|
||||
alreadyLinked: boolean;
|
||||
email?: string;
|
||||
linkedUserId?: string;
|
||||
};
|
||||
const inflightUserRequests = new Map<
|
||||
string,
|
||||
Promise<{
|
||||
ok: true;
|
||||
vip: boolean;
|
||||
alreadyLinked: boolean;
|
||||
email?: string;
|
||||
linkedUserId?: string;
|
||||
}>
|
||||
Promise<UserCheckPayload>
|
||||
>();
|
||||
const userCheckResultCache = new Map<
|
||||
string,
|
||||
{
|
||||
expiresAt: number;
|
||||
payload: {
|
||||
ok: true;
|
||||
vip: boolean;
|
||||
alreadyLinked: boolean;
|
||||
email?: string;
|
||||
linkedUserId?: string;
|
||||
};
|
||||
payload: UserCheckPayload;
|
||||
}
|
||||
>();
|
||||
const USER_CHECK_CACHE_TTL_MS = Number(process.env.CHECK_BY_USER_CACHE_TTL_MS) || 10_000;
|
||||
|
||||
Reference in New Issue
Block a user