Skip to content

Commit

Permalink
refactor: move default time out to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Aug 30, 2024
1 parent 56b36a3 commit 241cc63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ func main() {
}
}

const DEFAULT_CHECK_TIMEOUT = 60

func startServer(ctx context.Context, d *daemon, tcpListener, metricsUsername, metricPassword string) error {
log.Printf("Starting %s %s\n", name, version)
l, err := net.Listen("tcp", tcpListener)
Expand Down Expand Up @@ -99,7 +101,7 @@ func startServer(ctx context.Context, d *daemon, tcpListener, metricsUsername, m
err = errors.New("missing 'cid' query parameter")

Check warning on line 101 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L101

Added line #L101 was not covered by tests
}

timeout := 60
timeout := DEFAULT_CHECK_TIMEOUT
if timeoutStr != "" {
timeout, err = strconv.Atoi(timeoutStr)
if err != nil {
Expand Down

0 comments on commit 241cc63

Please sign in to comment.