MCPcopy Create free account
hub / github.com/cortexkit/magic-context / closeQuietly

Function closeQuietly

packages/plugin/src/shared/sqlite-helpers.ts:17–27  ·  view source on GitHub ↗
(db: Database | null | undefined)

Source from the content-addressed store, hash-verified

15 * doesn't care whether the close succeeded.
16 */
17export function closeQuietly(db: Database | null | undefined): void {
18 if (!db) return;
19 // Just attempt close and swallow errors. bun:sqlite has no `open` property,
20 // and node:sqlite throws on an already-closed handle — both are handled by
21 // the bare try/catch.
22 try {
23 db.close();
24 } catch {
25 // intentional: caller wants quiet close
26 }
27}

Callers 15

serverFunction · 0.90
tools.test.tsFile · 0.90
tools.test.tsFile · 0.90
sweepProjectFunction · 0.90
openDatabaseFunction · 0.90
closeDatabaseFunction · 0.90

Calls 1

closeMethod · 0.45

Tested by 10

createOpenCodeDbFunction · 0.72
createOpenCodeDbFunction · 0.72
createOpenCodeDbFunction · 0.72
createOpenCodeDbFunction · 0.72
createOpenCodeDbFunction · 0.72
createOpenCodeDbFunction · 0.72
appendOpenCodeMessageFunction · 0.72
renderFunction · 0.72