addded thumbnails to the new inheritance strategy

This commit is contained in:
A.Unger
2021-11-11 15:52:56 +01:00
parent 59f53390a8
commit 5f19300aaa
5 changed files with 37 additions and 52 deletions

View File

@@ -5,7 +5,6 @@ package command
import (
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/shared"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/owncloud/ocis/thumbnails/pkg/command"
"github.com/urfave/cli/v2"
@@ -13,8 +12,6 @@ import (
// ThumbnailsCommand is the entrypoint for the thumbnails command.
func ThumbnailsCommand(cfg *config.Config) *cli.Command {
var globalLog shared.Log
return &cli.Command{
Name: "thumbnails",
Usage: "Start thumbnails server",
@@ -27,16 +24,13 @@ func ThumbnailsCommand(cfg *config.Config) *cli.Command {
return err
}
globalLog = cfg.Log
if cfg.Commons != nil {
cfg.Thumbnails.Commons = cfg.Commons
}
return nil
},
Action: func(c *cli.Context) error {
// if thumbnails logging is empty in ocis.yaml
if (cfg.Thumbnails.Log == shared.Log{}) && (globalLog != shared.Log{}) {
// we can safely inherit the global logging values.
cfg.Thumbnails.Log = globalLog
}
origCmd := command.Server(cfg.Thumbnails)
return handleOriginalAction(c, origCmd)
},