From c73d07d3294418b4d41492c69fa0f62ca373dfe2 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Tue, 13 Sep 2022 09:16:21 -0700 Subject: [PATCH] clarified var --- lib/session.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/session.js b/lib/session.js index 883726e7..7feafc15 100644 --- a/lib/session.js +++ b/lib/session.js @@ -8,8 +8,8 @@ import clickhouse from 'lib/clickhouse'; export async function getSession(req) { const { payload } = getJsonBody(req); - const isRedis = redis.client; - const isClickhouse = clickhouse.client; + const hasRedis = redis.client; + const hasClickhouse = clickhouse.client; if (!payload) { throw new Error('Invalid request'); @@ -34,7 +34,7 @@ export async function getSession(req) { let websiteId = null; // Check if website exists - if (isRedis) { + if (hasRedis) { websiteId = Number(await redis.client.get(`website:${website_uuid}`)); } @@ -54,9 +54,9 @@ export async function getSession(req) { let sessionId = null; let session = null; - if (!isClickhouse) { + if (!hasClickhouse) { // Check if session exists - if (isRedis) { + if (hasRedis) { sessionId = Number(await redis.client.get(`session:${session_uuid}`)); }