sequential access to viper config (still broken) + add delayed execution to storage-sharing

This commit is contained in:
A.Unger
2021-03-10 12:26:14 +01:00
parent 0d3350497a
commit 6054e6b4a1
15 changed files with 72 additions and 1 deletions

View File

@@ -5,6 +5,8 @@ import (
"os"
"strings"
"github.com/owncloud/ocis/ocis-pkg/sync"
"github.com/micro/cli/v2"
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
@@ -69,6 +71,8 @@ func NewLogger(cfg *config.Config) log.Logger {
// ParseConfig loads settings configuration from Viper known paths.
func ParseConfig(c *cli.Context, cfg *config.Config) error {
sync.ParsingViperConfig.Lock()
defer sync.ParsingViperConfig.Unlock()
logger := NewLogger(cfg)
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))