mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
break CH fetch
This commit is contained in:
parent
86bd9a7793
commit
5dd395918f
@ -2,7 +2,6 @@ import { uuid } from 'lib/crypto';
|
|||||||
import redis, { DELETED } from 'lib/redis';
|
import redis, { DELETED } from 'lib/redis';
|
||||||
import { getClientInfo, getJsonBody } from 'lib/request';
|
import { getClientInfo, getJsonBody } from 'lib/request';
|
||||||
import { parseToken } from 'next-basics';
|
import { parseToken } from 'next-basics';
|
||||||
import { getWebsiteByUuid } from 'queries';
|
|
||||||
import { validate } from 'uuid';
|
import { validate } from 'uuid';
|
||||||
|
|
||||||
export async function getSession(req) {
|
export async function getSession(req) {
|
||||||
@ -36,14 +35,16 @@ export async function getSession(req) {
|
|||||||
websiteId = Number(await redis.client.get(`website:${website_uuid}`));
|
websiteId = Number(await redis.client.get(`website:${website_uuid}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check database if does not exists in Redis
|
// // Check database if does not exists in Redis
|
||||||
if (!websiteId) {
|
// if (!websiteId) {
|
||||||
const website = await getWebsiteByUuid(website_uuid);
|
// const website = await getWebsiteByUuid(website_uuid);
|
||||||
websiteId = website ? website.website_id : null;
|
// websiteId = website ? website.website_id : null;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!websiteId || websiteId === DELETED) {
|
if (!websiteId || websiteId === DELETED) {
|
||||||
throw new Error(`Website not found: ${website_uuid}`);
|
throw new Error(
|
||||||
|
`Website not found: ${website_uuid} : ${process.env.REDIS_URL} : ${process.env.CLICKHOUSE_URL}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { userAgent, browser, os, ip, country, device } = await getClientInfo(req, payload);
|
const { userAgent, browser, os, ip, country, device } = await getClientInfo(req, payload);
|
||||||
|
Loading…
Reference in New Issue
Block a user