Skip to content

Commit

Permalink
fix: correctly log eager seed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Apr 1, 2024
1 parent 009c10a commit 5612902
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/db/src/core/integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,17 @@ function astroDBIntegration(): AstroIntegration {
seedInFlight = true;
const mod = server.moduleGraph.getModuleById(resolved.seedVirtual);
if (mod) server.moduleGraph.invalidateModule(mod);
server.ssrLoadModule(resolved.seedVirtual).then(() => {
seedInFlight = false;
logger.info('Seeded database.');
});
server
.ssrLoadModule(resolved.seedVirtual)
.then(() => {
logger.info('Seeded database.');
})
.catch((e) => {
logger.error(e instanceof Error ? e.message : String(e));
})
.finally(() => {
seedInFlight = false;
});
}
}, 100);
},
Expand Down

0 comments on commit 5612902

Please sign in to comment.