mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
decrease db query count
This commit is contained in:
parent
f8ac987bfc
commit
e6975b9afc
@ -158,11 +158,7 @@ export async function createSession(website_id, data) {
|
|||||||
return runQuery(
|
return runQuery(
|
||||||
prisma.session.create({
|
prisma.session.create({
|
||||||
data: {
|
data: {
|
||||||
website: {
|
website: website_id,
|
||||||
connect: {
|
|
||||||
website_id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
...data,
|
...data,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
@ -186,16 +182,8 @@ export async function savePageView(website_id, session_id, url, referrer) {
|
|||||||
return runQuery(
|
return runQuery(
|
||||||
prisma.pageview.create({
|
prisma.pageview.create({
|
||||||
data: {
|
data: {
|
||||||
website: {
|
website: website_id,
|
||||||
connect: {
|
session: session_id,
|
||||||
website_id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
session: {
|
|
||||||
connect: {
|
|
||||||
session_id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
url: url.substr(0, URL_LENGTH),
|
url: url.substr(0, URL_LENGTH),
|
||||||
referrer: referrer.substr(0, URL_LENGTH),
|
referrer: referrer.substr(0, URL_LENGTH),
|
||||||
},
|
},
|
||||||
@ -207,16 +195,8 @@ export async function saveEvent(website_id, session_id, url, event_type, event_v
|
|||||||
return runQuery(
|
return runQuery(
|
||||||
prisma.event.create({
|
prisma.event.create({
|
||||||
data: {
|
data: {
|
||||||
website: {
|
website: website_id,
|
||||||
connect: {
|
session: session_id,
|
||||||
website_id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
session: {
|
|
||||||
connect: {
|
|
||||||
session_id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
url: url.substr(0, URL_LENGTH),
|
url: url.substr(0, URL_LENGTH),
|
||||||
event_type,
|
event_type,
|
||||||
event_value,
|
event_value,
|
||||||
|
Loading…
Reference in New Issue
Block a user