mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e7cb613cec
1 changed files with 41 additions and 29 deletions
|
|
@ -137,6 +137,9 @@ export async function resetWebsite(websiteId: string) {
|
||||||
|
|
||||||
return transaction(
|
return transaction(
|
||||||
[
|
[
|
||||||
|
client.revenue.deleteMany({
|
||||||
|
where: { websiteId },
|
||||||
|
}),
|
||||||
client.eventData.deleteMany({
|
client.eventData.deleteMany({
|
||||||
where: { websiteId },
|
where: { websiteId },
|
||||||
}),
|
}),
|
||||||
|
|
@ -175,7 +178,11 @@ export async function deleteWebsite(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.revenue.deleteMany({
|
||||||
|
where: { websiteId },
|
||||||
|
}),
|
||||||
client.eventData.deleteMany({
|
client.eventData.deleteMany({
|
||||||
where: { websiteId },
|
where: { websiteId },
|
||||||
}),
|
}),
|
||||||
|
|
@ -189,9 +196,10 @@ export async function deleteWebsite(websiteId: string) {
|
||||||
where: { websiteId },
|
where: { websiteId },
|
||||||
}),
|
}),
|
||||||
client.report.deleteMany({
|
client.report.deleteMany({
|
||||||
where: {
|
where: { websiteId },
|
||||||
websiteId,
|
}),
|
||||||
},
|
client.segment.deleteMany({
|
||||||
|
where: { websiteId },
|
||||||
}),
|
}),
|
||||||
cloudMode
|
cloudMode
|
||||||
? client.website.update({
|
? client.website.update({
|
||||||
|
|
@ -203,7 +211,11 @@ export async function deleteWebsite(websiteId: string) {
|
||||||
: client.website.delete({
|
: client.website.delete({
|
||||||
where: { id: websiteId },
|
where: { id: websiteId },
|
||||||
}),
|
}),
|
||||||
]).then(async data => {
|
],
|
||||||
|
{
|
||||||
|
timeout: 30000,
|
||||||
|
},
|
||||||
|
).then(async data => {
|
||||||
if (cloudMode) {
|
if (cloudMode) {
|
||||||
await redis.client.del(`website:${websiteId}`);
|
await redis.client.del(`website:${websiteId}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue