X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=main.go;h=fd1480e8237d6436deaae6ddb8ffccc9ddec09e2;hb=e9b18cd409f82928e1c4de3029ee1cc2d3816552;hp=49f36a5de2e69e63ae58357c05a6070beeb177fe;hpb=66496d63e16635d72f15abe48dc3dadb473f0b6b;p=src%2Fxds%2Fxds-server.git diff --git a/main.go b/main.go index 49f36a5..fd1480e 100644 --- a/main.go +++ b/main.go @@ -144,13 +144,14 @@ func xdsApp(cliCtx *cli.Context) error { // Establish connection with local Syncthing (retry if connection fail) fmt.Printf("Establishing connection with Syncthing...\n") time.Sleep(2 * time.Second) - retry := 10 + maxRetry := 30 + retry := maxRetry err = nil for retry > 0 { if err = ctx.SThg.Connect(); err == nil { break } - ctx.Log.Warningf("Establishing connection to Syncthing (retry %d/10)", retry) + ctx.Log.Warningf("Establishing connection to Syncthing (retry %d/%d)", retry, maxRetry) time.Sleep(time.Second) retry-- } @@ -178,12 +179,16 @@ func xdsApp(cliCtx *cli.Context) error { return cli.NewExitError(err, 2) } for _, stFld := range stCfg.Folders { - relativePath := strings.TrimPrefix(stFld.RawPath, ctx.Config.ShareRootDir) + relativePath := strings.TrimPrefix(stFld.RawPath, ctx.Config.FileConf.ShareRootDir) if relativePath == "" { relativePath = stFld.RawPath } - newFld := xdsconfig.NewFolderConfig(stFld.ID, stFld.Label, ctx.Config.ShareRootDir, strings.TrimRight(relativePath, "/"), defaultSdk) + newFld := xdsconfig.NewFolderConfig(stFld.ID, + stFld.Label, + ctx.Config.FileConf.ShareRootDir, + strings.TrimRight(relativePath, "/"), + defaultSdk) ctx.Config.Folders = ctx.Config.Folders.Update(xdsconfig.FoldersConfig{newFld}) }