POC: extensions promoting their own setting bundles onto the settings service

This commit is contained in:
A.Unger
2020-04-17 13:42:13 +02:00
parent 16c5e08843
commit 86c52618ea
4 changed files with 113 additions and 101 deletions
+9 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/oklog/run"
"github.com/owncloud/ocis-accounts/pkg/config"
"github.com/owncloud/ocis-accounts/pkg/server/grpc"
svc "github.com/owncloud/ocis-accounts/pkg/service/v0"
oclog "github.com/owncloud/ocis-pkg/v2/log"
)
@@ -65,7 +66,12 @@ func Server(cfg *config.Config) *cli.Command {
},
},
Before: func(c *cli.Context) error {
logger = oclog.NewLogger(oclog.Name(cfg.Server.Name))
logger = oclog.NewLogger(
oclog.Name(cfg.Server.Name),
oclog.Level("info"),
oclog.Color(true),
oclog.Pretty(true),
)
return ParseConfig(c, cfg)
},
Action: func(c *cli.Context) error {
@@ -83,6 +89,8 @@ func Server(cfg *config.Config) *cli.Command {
)
gr.Add(func() error {
logger.Info().Str("service", service.Name()).Msg("Reporting settings bundle to account service")
go svc.ReportSettingsBundle(&logger)
return service.Run()
}, func(_ error) {
fmt.Println("shutting down grpc server")