mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Refactor redis calls.
This commit is contained in:
parent
7f3db334f5
commit
d05fd2bd3d
7 changed files with 15 additions and 15 deletions
|
|
@ -30,8 +30,8 @@ async function relationalQuery(websiteId, data) {
|
|||
},
|
||||
})
|
||||
.then(async res => {
|
||||
if (redis.client && res) {
|
||||
await redis.client.set(`session:${res.sessionUuid}`, 1);
|
||||
if (redis.enabled && res) {
|
||||
await redis.set(`session:${res.sessionUuid}`, 1);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
@ -59,7 +59,7 @@ async function clickhouseQuery(
|
|||
|
||||
await sendMessage(params, 'event');
|
||||
|
||||
if (redis.client) {
|
||||
await redis.client.set(`session:${sessionUuid}`, 1);
|
||||
if (redis.enabled) {
|
||||
await redis.set(`session:${sessionUuid}`, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ async function relationalQuery(sessionUuid) {
|
|||
},
|
||||
})
|
||||
.then(async res => {
|
||||
if (redis.client && res) {
|
||||
await redis.client.set(`session:${res.sessionUuid}`, 1);
|
||||
if (redis.enabled && res) {
|
||||
await redis.set(`session:${res.sessionUuid}`, 1);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
@ -48,8 +48,8 @@ async function clickhouseQuery(sessionUuid) {
|
|||
)
|
||||
.then(result => findFirst(result))
|
||||
.then(async res => {
|
||||
if (redis.client && res) {
|
||||
await redis.client.set(`session:${res.session_uuid}`, 1);
|
||||
if (redis.enabled && res) {
|
||||
await redis.set(`session:${res.session_uuid}`, 1);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue