Merge pull request #15457 from bergquist/distributed_cache

Distributed cache
This commit is contained in:
Carl Bergquist
2019-03-14 16:16:39 +01:00
committed by GitHub
18 changed files with 679 additions and 2 deletions

View File

@@ -241,6 +241,9 @@ type Cfg struct {
// User
EditorsCanOwn bool
// DistributedCache
RemoteCacheOptions *RemoteCacheOptions
}
type CommandLineArgs struct {
@@ -781,9 +784,20 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
enterprise := iniFile.Section("enterprise")
cfg.EnterpriseLicensePath = enterprise.Key("license_path").MustString(filepath.Join(cfg.DataPath, "license.jwt"))
cacheServer := iniFile.Section("remote_cache")
cfg.RemoteCacheOptions = &RemoteCacheOptions{
Name: cacheServer.Key("type").MustString("database"),
ConnStr: cacheServer.Key("connstr").MustString(""),
}
return nil
}
type RemoteCacheOptions struct {
Name string
ConnStr string
}
func (cfg *Cfg) readSessionConfig() {
sec := cfg.Raw.Section("session")
SessionOptions = session.Options{}