mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-02 05:04:28 +01:00
Remove Sentry from SqliteWorker
It seems to be destroying CPU performance?
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/// <reference lib="webworker" />
|
||||
|
||||
import { Comlink, type CompiledQuery, Debug, DenoSqlite3, type QueryResult, Sentry } from '@/deps.ts';
|
||||
import { Comlink, type CompiledQuery, Debug, DenoSqlite3, type QueryResult } from '@/deps.ts';
|
||||
import '@/sentry.ts';
|
||||
|
||||
let db: DenoSqlite3 | undefined;
|
||||
@@ -13,16 +13,11 @@ export const SqliteWorker = {
|
||||
executeQuery<R>({ sql, parameters }: CompiledQuery): QueryResult<R> {
|
||||
if (!db) throw new Error('Database not open');
|
||||
debug(sql);
|
||||
|
||||
const result: QueryResult<R> = Sentry.startSpan({ name: sql, op: 'db.query' }, () => {
|
||||
return {
|
||||
rows: db!.prepare(sql).all(...parameters as any[]) as R[],
|
||||
numAffectedRows: BigInt(db!.changes),
|
||||
insertId: BigInt(db!.lastInsertRowId),
|
||||
};
|
||||
});
|
||||
|
||||
return result;
|
||||
return {
|
||||
rows: db!.prepare(sql).all(...parameters as any[]) as R[],
|
||||
numAffectedRows: BigInt(db!.changes),
|
||||
insertId: BigInt(db!.lastInsertRowId),
|
||||
};
|
||||
},
|
||||
destroy() {
|
||||
db?.close();
|
||||
|
||||
Reference in New Issue
Block a user