Skip to content

Commit

Permalink
Update parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nagdahimanshu committed Jun 25, 2024
1 parent 122de64 commit 8b29037
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8b29037

Please sign in to comment.