@palbase/backend 24.1.1 → 24.2.0

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.
@@ -3,7 +3,7 @@ import {
3
3
  BootRefused,
4
4
  createApp,
5
5
  loadConfig
6
- } from "../chunk-2A62DDVO.js";
6
+ } from "../chunk-EIXCY4SS.js";
7
7
  import "../chunk-7Z6MGMXQ.js";
8
8
  import "../chunk-XABBC7JP.js";
9
9
  import "../chunk-P2Q27SGP.js";
@@ -2009,7 +2009,7 @@ async function createApp(opts) {
2009
2009
  const completions = new CompletionLedger();
2010
2010
  function buildServices(db) {
2011
2011
  return {
2012
- Database: db.client,
2012
+ Database: db?.client ?? stubModule("Database (a start hook runs before any request \u2014 open your own connection here)"),
2013
2013
  Cache: cache,
2014
2014
  Log: log,
2015
2015
  Documents: modules.Documents ?? stubModule("Documents"),
@@ -2388,9 +2388,10 @@ async function createApp(opts) {
2388
2388
  return envelope("internal_error", "The request could not be completed", 500, requestId);
2389
2389
  }
2390
2390
  }
2391
+ const bootServices = buildServices(null);
2391
2392
  let runShutdownHooks;
2392
2393
  try {
2393
- runShutdownHooks = await __runStartHooks();
2394
+ runShutdownHooks = await runWithRuntime(bootServices, () => __runStartHooks());
2394
2395
  } catch (err) {
2395
2396
  await closeDriver(sql);
2396
2397
  throw err;
@@ -2431,4 +2432,4 @@ export {
2431
2432
  installEgressFence,
2432
2433
  createApp
2433
2434
  };
2434
- //# sourceMappingURL=chunk-2A62DDVO.js.map
2435
+ //# sourceMappingURL=chunk-EIXCY4SS.js.map