Remove Sentry from SqliteWorker

It seems to be destroying CPU performance?
This commit is contained in:
Alex Gleason 2024-02-17 14:34:38 -06:00
parent 491c3f5125
commit 7a38cfbc40
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 6 additions and 11 deletions

View File

@ -1,6 +1,6 @@
/// <reference lib="webworker" /> /// <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'; import '@/sentry.ts';
let db: DenoSqlite3 | undefined; let db: DenoSqlite3 | undefined;
@ -13,16 +13,11 @@ export const SqliteWorker = {
executeQuery<R>({ sql, parameters }: CompiledQuery): QueryResult<R> { executeQuery<R>({ sql, parameters }: CompiledQuery): QueryResult<R> {
if (!db) throw new Error('Database not open'); if (!db) throw new Error('Database not open');
debug(sql); debug(sql);
return {
const result: QueryResult<R> = Sentry.startSpan({ name: sql, op: 'db.query' }, () => { rows: db!.prepare(sql).all(...parameters as any[]) as R[],
return { numAffectedRows: BigInt(db!.changes),
rows: db!.prepare(sql).all(...parameters as any[]) as R[], insertId: BigInt(db!.lastInsertRowId),
numAffectedRows: BigInt(db!.changes), };
insertId: BigInt(db!.lastInsertRowId),
};
});
return result;
}, },
destroy() { destroy() {
db?.close(); db?.close();