niahere 0.5.9 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/health.ts +5 -1
package/package.json
CHANGED
package/src/core/health.ts
CHANGED
|
@@ -272,8 +272,12 @@ export async function runHealthChecks(): Promise<Check[]> {
|
|
|
272
272
|
// Replies written but never confirmed sent. 25 code paths write this column
|
|
273
273
|
// and, until now, nothing read it.
|
|
274
274
|
try {
|
|
275
|
+
// withDb, not a bare getSql(): the CLI must be able to exit afterwards, and
|
|
276
|
+
// a lazily-opened connection nobody closes keeps the event loop alive.
|
|
277
|
+
const { withDb } = await import("../db/with-db");
|
|
275
278
|
const { Message } = await import("../db/models");
|
|
276
|
-
|
|
279
|
+
const pending = await withDb(() => Message.listPendingDeliveries());
|
|
280
|
+
checks.push(auditDelivery(pending));
|
|
277
281
|
} catch (err) {
|
|
278
282
|
checks.push({ name: "delivery", status: "warn", detail: errMsg(err) });
|
|
279
283
|
}
|