mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Increase resetWebsite timeout. fix retention bug returning decimal day_number in CH.
Closes #3698
This commit is contained in:
parent
a3f32b036d
commit
cc8254985b
2 changed files with 26 additions and 21 deletions
|
|
@ -135,26 +135,31 @@ export async function resetWebsite(websiteId: string) {
|
||||||
const { client, transaction } = prisma;
|
const { client, transaction } = prisma;
|
||||||
const cloudMode = !!process.env.CLOUD_MODE;
|
const cloudMode = !!process.env.CLOUD_MODE;
|
||||||
|
|
||||||
return transaction([
|
return transaction(
|
||||||
client.eventData.deleteMany({
|
[
|
||||||
where: { websiteId },
|
client.eventData.deleteMany({
|
||||||
}),
|
where: { websiteId },
|
||||||
client.sessionData.deleteMany({
|
}),
|
||||||
where: { websiteId },
|
client.sessionData.deleteMany({
|
||||||
}),
|
where: { websiteId },
|
||||||
client.websiteEvent.deleteMany({
|
}),
|
||||||
where: { websiteId },
|
client.websiteEvent.deleteMany({
|
||||||
}),
|
where: { websiteId },
|
||||||
client.session.deleteMany({
|
}),
|
||||||
where: { websiteId },
|
client.session.deleteMany({
|
||||||
}),
|
where: { websiteId },
|
||||||
client.website.update({
|
}),
|
||||||
where: { id: websiteId },
|
client.website.update({
|
||||||
data: {
|
where: { id: websiteId },
|
||||||
resetAt: new Date(),
|
data: {
|
||||||
},
|
resetAt: new Date(),
|
||||||
}),
|
},
|
||||||
]).then(async data => {
|
}),
|
||||||
|
],
|
||||||
|
{
|
||||||
|
timeout: 30000,
|
||||||
|
},
|
||||||
|
).then(async data => {
|
||||||
if (cloudMode) {
|
if (cloudMode) {
|
||||||
await redis.client.set(
|
await redis.client.set(
|
||||||
`website:${websiteId}`,
|
`website:${websiteId}`,
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ async function clickhouseQuery(
|
||||||
user_activities AS (
|
user_activities AS (
|
||||||
select distinct
|
select distinct
|
||||||
website_event.session_id,
|
website_event.session_id,
|
||||||
(${getDateSQL('created_at', unit, timezone)} - cohort_items.cohort_date) / 86400 as day_number
|
toInt32((${getDateSQL('created_at', unit, timezone)} - cohort_items.cohort_date) / 86400) as day_number
|
||||||
from website_event
|
from website_event
|
||||||
join cohort_items
|
join cohort_items
|
||||||
on website_event.session_id = cohort_items.session_id
|
on website_event.session_id = cohort_items.session_id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue