mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-26 10:43:42 +02:00
cmd/thalos/server.go: in GetConfig() should override "no-state-cache" flag if "start-block" flag is set.
This commit is contained in:
parent
7f1f186aa0
commit
146ea99298
1 changed files with 9 additions and 2 deletions
|
|
@ -219,6 +219,13 @@ func GetConfig(flags *pflag.FlagSet) (*config.Config, error) {
|
||||||
cfg.Log.Filename = path.Base(logFile)
|
cfg.Log.Filename = path.Base(logFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If start-block is provided, we should set no-state-cache to true.
|
||||||
|
if startBlock := flags.Lookup("start-block"); startBlock != nil && startBlock.Changed {
|
||||||
|
if err := flags.Set("no-state-cache", "true"); err != nil {
|
||||||
|
return cfg, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return cfg, nil
|
return cfg, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,8 +233,6 @@ func serverCmd(cmd *cobra.Command, args []string) {
|
||||||
var err error
|
var err error
|
||||||
var chainInfo *eos.InfoResp
|
var chainInfo *eos.InfoResp
|
||||||
|
|
||||||
skip_currentblock_cache, _ := cmd.Flags().GetBool("no-state-cache")
|
|
||||||
|
|
||||||
// Write PID file
|
// Write PID file
|
||||||
pidFile, err := cmd.Flags().GetString("pid")
|
pidFile, err := cmd.Flags().GetString("pid")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -245,6 +250,8 @@ func serverCmd(cmd *cobra.Command, args []string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skip_currentblock_cache, _ := cmd.Flags().GetBool("no-state-cache")
|
||||||
|
|
||||||
flagLevel, _ := cmd.Flags().GetString("level")
|
flagLevel, _ := cmd.Flags().GetString("level")
|
||||||
lvl, err := log.ParseLevel(flagLevel)
|
lvl, err := log.ParseLevel(flagLevel)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue