1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-06 06:26:46 +00:00

feature(manager): implement manager server, to be tested

这个提交包含在:
walkerning
2016-04-24 22:33:42 +08:00
提交者 bigeagle
父节点 6062aa4b9d
当前提交 bf31e168a2
共有 6 个文件被更改,包括 341 次插入25 次删除

查看文件

@@ -24,6 +24,7 @@ type ServerConfig struct {
type FileConfig struct {
StatusFile string `toml:"status_file"`
DBFile string `toml:"db_file"`
DBType string `toml:"db_type"`
// used to connect to worker
CACert string `toml:"ca_cert"`
}
@@ -36,6 +37,7 @@ func loadConfig(cfgFile string, c *cli.Context) (*Config, error) {
cfg.Debug = false
cfg.Files.StatusFile = "/var/lib/tunasync/tunasync.json"
cfg.Files.DBFile = "/var/lib/tunasync/tunasync.db"
cfg.Files.DBType = "bolt"
if cfgFile != "" {
if _, err := toml.DecodeFile(cfgFile, cfg); err != nil {
@@ -60,6 +62,9 @@ func loadConfig(cfgFile string, c *cli.Context) (*Config, error) {
if c.String("db-file") != "" {
cfg.Files.DBFile = c.String("db-file")
}
if c.String("db-type") != "" {
cfg.Files.DBFile = c.String("db-type")
}
return cfg, nil
}