Merge pull request #3957 from owncloud/make-ocdav-service-behave

Make ocdav service behave
This commit is contained in:
Jörn Friedrich Dreyer
2022-06-14 07:48:06 +00:00
committed by GitHub
2 changed files with 17 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
Bugfix: make ocdav service behave properly
The ocdav service now properly passes the tracing config and shuts down when receiving a kill signal.
https://github.com/owncloud/ocis/pull/3957

View File

@@ -42,8 +42,9 @@ func Server(cfg *config.Config) *cli.Command {
defer cancel()
gr.Add(func() error {
s, err := ocdav.Service(
ocdav.Name(cfg.HTTP.Namespace+"."+cfg.Service.Name),
opts := []ocdav.Option{
ocdav.Name(cfg.HTTP.Namespace + "." + cfg.Service.Name),
ocdav.Version(version.GetString()),
ocdav.Context(ctx),
ocdav.Logger(logger.Logger),
@@ -63,10 +64,16 @@ func Server(cfg *config.Config) *cli.Command {
ocdav.Version(cfg.Status.Version),
ocdav.VersionString(cfg.Status.VersionString),
ocdav.Edition(cfg.Status.Edition),
// ocdav.FavoriteManager() // FIXME needs a proper persistence implementation
// ocdav.FavoriteManager() // FIXME needs a proper persistence implementation https://github.com/owncloud/ocis/issues/1228
// ocdav.LockSystem(), // will default to the CS3 lock system
// ocdav.TLSConfig() // tls config for the http server
)
}
if cfg.Tracing.Enabled {
opts = append(opts, ocdav.Tracing(cfg.Tracing.Endpoint, cfg.Tracing.Collector))
}
s, err := ocdav.Service(opts...)
if err != nil {
return err
}
@@ -89,6 +96,7 @@ func Server(cfg *config.Config) *cli.Command {
}
gr.Add(debugServer.ListenAndServe, func(_ error) {
_ = debugServer.Shutdown(ctx)
cancel()
})