Skip to content

Commit

Permalink
fix: use heartbeat env var instead of 5
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-bahjati committed Oct 31, 2023
1 parent 3d07160 commit 22fceb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (h *Heartbeat) Handle(w http.ResponseWriter, r *http.Request) {
lastHeartbeat := time.Unix(h.Timestamp, 0)
interval := time.Since(lastHeartbeat)

if interval < 5*time.Second {
if interval < time.Duration(h.Interval)*time.Second {
log.Debug().Dur("interval_ms", interval).Msg("Heartbeat succeeded")
w.WriteHeader(200)
} else {
Expand Down

0 comments on commit 22fceb8

Please sign in to comment.