mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
fix(server): upload filters answer multer once on a throwing callback; positive call-graph gate test
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Fixture for `db-call-graph.mjs --sync --tx --root scripts/__fixtures__`: one class that
|
||||
* still touches the database synchronously and opens a raw transaction, so the two gates
|
||||
* CI runs (`--sync`, `--tx`) each have a known-bad case to report. `unawaited-sample.ts`
|
||||
* beside it is clean under both flags.
|
||||
*/
|
||||
|
||||
interface RawDb {
|
||||
get(sql: string, ...args: unknown[]): unknown;
|
||||
transaction<T>(fn: () => T): T;
|
||||
}
|
||||
|
||||
export class SyncSample {
|
||||
private db: RawDb = { get: () => undefined, transaction: (fn) => fn() };
|
||||
|
||||
readSync(id: number): unknown {
|
||||
return this.db.get('SELECT 1 WHERE id = ?', id); // sync DB-touching method
|
||||
}
|
||||
|
||||
writeInTx(): void {
|
||||
this.db.transaction(() => undefined); // raw transaction site
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user