mirror of
https://github.com/niusmallnan/steve.git
synced 2025-07-18 16:41:13 +00:00
Make aggregation start explicitly or on Listen
This commit is contained in:
parent
9ddd83c343
commit
86ca5628f7
@ -167,9 +167,6 @@ func setup(ctx context.Context, server *Server) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
aggregation.Watch(ctx, server.controllers.Core.Secret(), server.aggregationSecretNamespace,
|
|
||||||
server.aggregationSecretName, handler)
|
|
||||||
|
|
||||||
server.APIServer = apiServer
|
server.APIServer = apiServer
|
||||||
server.Handler = handler
|
server.Handler = handler
|
||||||
server.SchemaFactory = sf
|
server.SchemaFactory = sf
|
||||||
@ -185,6 +182,11 @@ func (c *Server) start(ctx context.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Server) StartAggregation(ctx context.Context) {
|
||||||
|
aggregation.Watch(ctx, c.controllers.Core.Secret(), c.aggregationSecretNamespace,
|
||||||
|
c.aggregationSecretName, c)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Server) ListenAndServe(ctx context.Context, httpsPort, httpPort int, opts *server.ListenOpts) error {
|
func (c *Server) ListenAndServe(ctx context.Context, httpsPort, httpPort int, opts *server.ListenOpts) error {
|
||||||
if opts == nil {
|
if opts == nil {
|
||||||
opts = &server.ListenOpts{}
|
opts = &server.ListenOpts{}
|
||||||
@ -192,6 +194,9 @@ func (c *Server) ListenAndServe(ctx context.Context, httpsPort, httpPort int, op
|
|||||||
if opts.Storage == nil && opts.Secrets == nil {
|
if opts.Storage == nil && opts.Secrets == nil {
|
||||||
opts.Secrets = c.controllers.Core.Secret()
|
opts.Secrets = c.controllers.Core.Secret()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.StartAggregation(ctx)
|
||||||
|
|
||||||
if err := server.ListenAndServe(ctx, httpsPort, httpPort, c, opts); err != nil {
|
if err := server.ListenAndServe(ctx, httpsPort, httpPort, c, opts); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user