1
0
Fork 0
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:
Henrik Hautakoski 2024-02-18 20:07:35 +01:00
parent fb62e10667
commit 1658b3ea99

View file

@ -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")