Apps: call app.Runner().Run() in a goroutine in the post-start hook (#113371)

Run the app runner in a goroutine in the post-start hook, as the '/readyz' endpoint for the API server waits for a non-nil error response from the post-start hook to mark it as ready.
This commit is contained in:
Austin Pond
2025-11-03 17:05:20 -05:00
committed by GitHub
parent 126e6dbcd8
commit 0649635639
@@ -203,6 +203,14 @@ func createPostStartHook(
logger.Error("Failed to initialize app", "app", installer.ManifestData().AppName, "error", err)
return fmt.Errorf("failed to get app from installer %s: %w", installer.ManifestData().AppName, err)
}
return app.Runner().Run(hookContext.Context)
go func() {
err := app.Runner().Run(hookContext.Context)
if err != nil {
logger.Error("App runner exited with error", "app", installer.ManifestData().AppName, "error", err)
} else {
logger.Info("App runner exited without error", "app", installer.ManifestData().AppName)
}
}()
return nil
}
}