mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
cmd/thalos/server.go: parse config before doing anything else.
This commit is contained in:
parent
fb62e10667
commit
1658b3ea99
1 changed files with 7 additions and 7 deletions
|
|
@ -265,6 +265,13 @@ func chainInfoOnce(api *eos.API) func() *eos.InfoResp {
|
|||
func serverCmd(cmd *cobra.Command, args []string) {
|
||||
var err error
|
||||
|
||||
// Parse config
|
||||
conf, err := GetConfig(cmd.Flags())
|
||||
if err != nil {
|
||||
log.WithError(err).Fatal("Failed to read config")
|
||||
return
|
||||
}
|
||||
|
||||
// Write PID file
|
||||
pidFile, err := cmd.Flags().GetString("pid")
|
||||
if err != nil {
|
||||
|
|
@ -275,13 +282,6 @@ func serverCmd(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
}
|
||||
|
||||
// Parse config
|
||||
conf, err := GetConfig(cmd.Flags())
|
||||
if err != nil {
|
||||
log.WithError(err).Fatal("Failed to read config")
|
||||
return
|
||||
}
|
||||
|
||||
skip_currentblock_cache, _ := cmd.Flags().GetBool("no-state-cache")
|
||||
|
||||
flagLevel, _ := cmd.Flags().GetString("level")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue