add SyncMode to flags

pull/4465/head
“GheisMohammadi” 1 year ago
parent 12235f5c5c
commit f6b8951656
No known key found for this signature in database
GPG Key ID: 15073AED3829FE90
  1. 12
      cmd/harmony/flags.go

@ -238,6 +238,7 @@ var (
syncFlags = []cli.Flag{
syncStreamEnabledFlag,
syncModeFlag,
syncDownloaderFlag,
syncStagedSyncFlag,
syncConcurrencyFlag,
@ -1876,6 +1877,13 @@ var (
Usage: "Enable the stream sync protocol (experimental feature)",
DefValue: false,
}
syncModeFlag = cli.IntFlag{
Name: "sync.mode",
Usage: "synchronization mode of the downloader (0=FullSync, 1=FastSync, 2=SnapSync)",
DefValue: 0,
}
// TODO: Deprecate this flag, and always set to true after stream sync is fully up.
syncDownloaderFlag = cli.BoolFlag{
Name: "sync.downloader",
@ -1937,6 +1945,10 @@ func applySyncFlags(cmd *cobra.Command, config *harmonyconfig.HarmonyConfig) {
config.Sync.Enabled = cli.GetBoolFlagValue(cmd, syncStreamEnabledFlag)
}
if cli.IsFlagChanged(cmd, syncModeFlag) {
config.Sync.SyncMode = uint32(cli.GetIntFlagValue(cmd, syncModeFlag))
}
if cli.IsFlagChanged(cmd, syncDownloaderFlag) {
config.Sync.Downloader = cli.GetBoolFlagValue(cmd, syncDownloaderFlag)
}

Loading…
Cancel
Save