Skip to content

Commit 523561a

Browse files
authored
Update cli.go
1 parent 521715e commit 523561a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/cmd/txsim/cli.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ account that can act as the master account. The command runs until all sequences
177177
}
178178
}
179179

180-
pollTime, err = getPollTime(pollTime, os.Getenv(TxsimPoll), user.DefaultPollTime)
180+
pollTime, err = getPollTime(pollTime, os.Getenv(TxsimPoll), user.DefaultPollTime, cmd.Flags().Changed("poll-time"))
181181
if err != nil {
182182
return fmt.Errorf("get poll time: %w", err)
183183
}
@@ -297,8 +297,8 @@ func parseUpgradeSchedule(schedule string) (map[int64]uint64, error) {
297297

298298
// getPollTime returns the pollTime value based on CLI flag, environment variable, and default.
299299
// Priority: flag > env > default.
300-
func getPollTime(flagValue time.Duration, envValue string, defaultValue time.Duration) (time.Duration, error) {
301-
if flagValue != defaultValue {
300+
func getPollTime(flagValue time.Duration, envValue string, defaultValue time.Duration, flagChanged bool) (time.Duration, error) {
301+
if flagChanged {
302302
return flagValue, nil
303303
}
304304
if envValue != "" {

0 commit comments

Comments
 (0)