initServices If the app is configured to use services, this function registers a post shutdown hook to shutdown them after the server is closed. This function panics if there is an error starting the services.
()
| 47 | // a post shutdown hook to shutdown them after the server is closed. |
| 48 | // This function panics if there is an error starting the services. |
| 49 | func (app *App) initServices() { |
| 50 | if !app.hasConfiguredServices() { |
| 51 | return |
| 52 | } |
| 53 | |
| 54 | if err := app.startServices(app.servicesStartupCtx()); err != nil { |
| 55 | panic(err) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | // servicesStartupCtx Returns the context for the services startup. |
| 60 | // If the ServicesStartupContextProvider is not set, it returns a new background context. |
no test coverage detected