mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
Removed disconnect call.
This commit is contained in:
parent
a6975ecedd
commit
533ffbda13
@ -1,17 +1,13 @@
|
|||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
|
||||||
const prisma = new PrismaClient({
|
export const prisma = new PrismaClient({
|
||||||
log: [process.env.NODE_ENV !== 'production' && 'query'],
|
log: [process.env.NODE_ENV !== 'production' && 'query'],
|
||||||
});
|
});
|
||||||
|
|
||||||
export async function runQuery(query) {
|
export async function runQuery(query) {
|
||||||
return query
|
return query.catch(e => {
|
||||||
.catch(e => {
|
|
||||||
console.error(e);
|
console.error(e);
|
||||||
throw e;
|
throw e;
|
||||||
})
|
|
||||||
.finally(async () => {
|
|
||||||
await prisma.disconnect();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "umami",
|
"name": "umami",
|
||||||
"version": "0.1.0",
|
"version": "0.2.0",
|
||||||
"description": "Deliciously simple website stats",
|
"description": "Deliciously simple website stats",
|
||||||
"author": "Mike Cao <mike@mikecao.com>",
|
"author": "Mike Cao <mike@mikecao.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
Loading…
Reference in New Issue
Block a user