Skip to content

Commit

Permalink
Merge pull request #3957 from owncloud/make-ocdav-service-behave
Browse files Browse the repository at this point in the history
Make ocdav service behave
  • Loading branch information
butonic committed Jun 14, 2022
2 parents c4d762c + 61257ef commit f76cc17
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/make-ocdav-service-behave.md
Original file line number Diff line number Diff line change
@@ -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
16 changes: 12 additions & 4 deletions extensions/ocdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
}
Expand All @@ -89,6 +96,7 @@ func Server(cfg *config.Config) *cli.Command {
}

gr.Add(debugServer.ListenAndServe, func(_ error) {
_ = debugServer.Shutdown(ctx)
cancel()
})

Expand Down

0 comments on commit f76cc17

Please sign in to comment.