@palbase/backend 24.1.1 → 24.3.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.
@@ -2774,7 +2774,7 @@ async function createApp(opts) {
2774
2774
  const completions = new CompletionLedger();
2775
2775
  function buildServices(db) {
2776
2776
  return {
2777
- Database: db.client,
2777
+ Database: db?.client ?? stubModule("Database (a start hook runs before any request \u2014 open your own connection here)"),
2778
2778
  Cache: cache,
2779
2779
  Log: log,
2780
2780
  Documents: modules.Documents ?? stubModule("Documents"),
@@ -3153,9 +3153,10 @@ async function createApp(opts) {
3153
3153
  return envelope("internal_error", "The request could not be completed", 500, requestId);
3154
3154
  }
3155
3155
  }
3156
+ const bootServices = buildServices(null);
3156
3157
  let runShutdownHooks;
3157
3158
  try {
3158
- runShutdownHooks = await __runStartHooks();
3159
+ runShutdownHooks = await runWithRuntime(bootServices, () => __runStartHooks());
3159
3160
  } catch (err) {
3160
3161
  await closeDriver(sql);
3161
3162
  throw err;