From 8b29037991602d40e5fa841ec8619f30ea4f1cc4 Mon Sep 17 00:00:00 2001 From: nagdahimanshu Date: Tue, 25 Jun 2024 13:17:57 +0200 Subject: [PATCH] Update parsing --- internal/server/middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/server/middleware.go b/internal/server/middleware.go index 414c9577..5bd44de2 100644 --- a/internal/server/middleware.go +++ b/internal/server/middleware.go @@ -73,7 +73,7 @@ func (l *Limiter) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.Ha func (l *Limiter) limitByKey(w http.ResponseWriter, key string) bool { if _, ttl, err := l.cache.GetWithTTL(key); err == nil { - errMsg := fmt.Sprintf("You have exceeded the rate limit. Please wait %s before you try again", ttl.Round(time.Second)) + errMsg := fmt.Sprintf("You have exceeded the rate limit. Please wait %v days before you try again", ttl.Round(time.Hour).Hours()/24) renderJSON(w, claimResponse{Message: errMsg}, http.StatusTooManyRequests) return true }