Skip to content

Commit

Permalink
Add defaultPollInterval()
Browse files Browse the repository at this point in the history
  • Loading branch information
mniak committed Sep 18, 2020
1 parent 6a1560f commit 1a81473
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wait/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewHTTPStrategy(path string) *HTTPStrategy {
TLSConfig: nil,
Method: http.MethodGet,
Body: nil,
PollInterval: time.Second / 10,
PollInterval: defaultPollInterval(),
}
}

Expand Down
4 changes: 2 additions & 2 deletions wait/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ type LogStrategy struct {

// additional properties
Log string
PollInterval time.Duration
Occurrence int
PollInterval time.Duration
}

// NewLogStrategy constructs a HTTP strategy waiting on port 80 and status code 200
func NewLogStrategy(log string) *LogStrategy {
return &LogStrategy{
startupTimeout: defaultStartupTimeout(),
Log: log,
PollInterval: 100 * time.Millisecond,
Occurrence: 1,
PollInterval: defaultPollInterval(),
}

}
Expand Down
2 changes: 1 addition & 1 deletion wait/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func ForSQL(port nat.Port, driver string, url func(nat.Port) string) *waitForSql
URL: url,
Driver: driver,
startupTimeout: defaultStartupTimeout(),
PollInterval: 100 * time.Millisecond,
PollInterval: defaultPollInterval(),
}
}

Expand Down
4 changes: 4 additions & 0 deletions wait/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ type StrategyTarget interface {
func defaultStartupTimeout() time.Duration {
return 60 * time.Second
}

func defaultPollInterval() time.Duration {
return 100 * time.Millisecond
}

0 comments on commit 1a81473

Please sign in to comment.