mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
redis checkpoint
This commit is contained in:
parent
10cc6616c5
commit
818f8721e9
10 changed files with 187 additions and 34 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import { CLICKHOUSE, KAFKA, RELATIONAL } from 'lib/constants';
|
||||
import { prisma, runQuery } from 'lib/relational';
|
||||
import clickhouse from 'lib/clickhouse';
|
||||
import kafka from 'lib/kafka';
|
||||
import { CLICKHOUSE, KAFKA, RELATIONAL } from 'lib/constants';
|
||||
import { runAnalyticsQuery } from 'lib/db';
|
||||
import kafka from 'lib/kafka';
|
||||
import redis from 'lib/redis';
|
||||
import { prisma, runQuery } from 'lib/relational';
|
||||
|
||||
export async function createSession(...args) {
|
||||
return runAnalyticsQuery({
|
||||
|
|
@ -23,7 +24,13 @@ async function relationalQuery(website_id, data) {
|
|||
session_id: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
).then(async res => {
|
||||
if (process.env.REDIS_URL) {
|
||||
await redis.set(`session:${res.session_uuid}`, '');
|
||||
}
|
||||
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
async function clickhouseQuery(
|
||||
|
|
@ -67,4 +74,6 @@ async function kafkaQuery(
|
|||
};
|
||||
|
||||
await kafka.sendKafkaMessage(params, 'session');
|
||||
|
||||
await redis.set(`session:${session_uuid}`, '');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue