mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
clarified var
This commit is contained in:
parent
8e068310b8
commit
c73d07d329
@ -8,8 +8,8 @@ import clickhouse from 'lib/clickhouse';
|
|||||||
|
|
||||||
export async function getSession(req) {
|
export async function getSession(req) {
|
||||||
const { payload } = getJsonBody(req);
|
const { payload } = getJsonBody(req);
|
||||||
const isRedis = redis.client;
|
const hasRedis = redis.client;
|
||||||
const isClickhouse = clickhouse.client;
|
const hasClickhouse = clickhouse.client;
|
||||||
|
|
||||||
if (!payload) {
|
if (!payload) {
|
||||||
throw new Error('Invalid request');
|
throw new Error('Invalid request');
|
||||||
@ -34,7 +34,7 @@ export async function getSession(req) {
|
|||||||
let websiteId = null;
|
let websiteId = null;
|
||||||
|
|
||||||
// Check if website exists
|
// Check if website exists
|
||||||
if (isRedis) {
|
if (hasRedis) {
|
||||||
websiteId = Number(await redis.client.get(`website:${website_uuid}`));
|
websiteId = Number(await redis.client.get(`website:${website_uuid}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,9 +54,9 @@ export async function getSession(req) {
|
|||||||
let sessionId = null;
|
let sessionId = null;
|
||||||
let session = null;
|
let session = null;
|
||||||
|
|
||||||
if (!isClickhouse) {
|
if (!hasClickhouse) {
|
||||||
// Check if session exists
|
// Check if session exists
|
||||||
if (isRedis) {
|
if (hasRedis) {
|
||||||
sessionId = Number(await redis.client.get(`session:${session_uuid}`));
|
sessionId = Number(await redis.client.get(`session:${session_uuid}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user