feat: complete contract-driven business development and MySQL integration

This commit is contained in:
2026-09-24 21:56:04 +08:00
parent f9afb8f8dd
commit f5478cdc76
108 changed files with 6557 additions and 550 deletions

View File

@@ -34,19 +34,13 @@ func run(ctx context.Context, path string) (runErr error) {
return err
}
defer func() { runErr = errors.Join(runErr, logger.Close()) }()
logx.SetDefault(logger)
deps, err := svc.New(ctx, logger, cfg)
if err != nil {
return err
}
// RunContext drains HTTP requests before returning. This scope owns dependencies
// and closes them exactly once, before closing the borrowed logger.
defer func() {
runErr = errors.Join(runErr, deps.Close())
if cause := deps.Lifecycle.Err(); cause != nil && !errors.Is(runErr, cause) {
runErr = errors.Join(runErr, cause)
}
}()
defer func() { runErr = deps.Finish(runErr) }()
app, err := handler.NewApp(deps)
if err != nil {
return err