feat: complete contract-driven business development and MySQL integration
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user