Merge pull request #7382 from kobergj/sse-scalability

SSE Scalability
This commit is contained in:
kobergj
2023-09-28 16:53:18 +02:00
committed by GitHub
3 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
Enhancement: Make sse service scalable
When running multiple sse instances some events would not be reported to the user. This is fixed.
https://github.com/owncloud/ocis/pull/7382

View File

@@ -72,6 +72,9 @@ func Server(cfg *config.Config) *cli.Command {
http.RegisteredEvents(_registeredEvents),
http.TracerProvider(tracerProvider),
)
if err != nil {
return err
}
gr.Add(server.Run, func(_ error) {
cancel()

View File

@@ -8,6 +8,7 @@ import (
"github.com/cs3org/reva/v2/pkg/events"
"github.com/go-chi/chi/v5"
chimiddleware "github.com/go-chi/chi/v5/middleware"
"github.com/google/uuid"
"github.com/owncloud/ocis/v2/ocis-pkg/account"
"github.com/owncloud/ocis/v2/ocis-pkg/cors"
"github.com/owncloud/ocis/v2/ocis-pkg/middleware"
@@ -78,7 +79,7 @@ func Server(opts ...Option) (http.Service, error) {
),
)
ch, err := events.Consume(options.Consumer, "sse", options.RegisteredEvents...)
ch, err := events.Consume(options.Consumer, "sse-"+uuid.New().String(), options.RegisteredEvents...)
if err != nil {
return http.Service{}, err
}