Browse Source

Update database.rkt

master
Wesley Kerfoot 11 years ago
parent
commit
8a85a750ed
  1. 4
      database.rkt

4
database.rkt

@ -124,7 +124,7 @@
(define (rate-check-helper mag hN n k)
(let ([hN (bytes->number hN)])
(cond
[(and (> k mag) (eq? hN n)) #f]
[(and (> k mag) (= hN n)) #f]
[(and (< mag k) (< hN n)) (redis-hincrby "counter" "n" "1") #t]
[else (redis-hset "counter" "n" "0")
(redis-hset "counter" "current" (number->string (current-inexact-milliseconds)))
@ -141,4 +141,4 @@
(define allowed? (rate-check 10 (* 2 60000)))
;; Admin Stuff
(provide (all-defined-out))
(provide (all-defined-out))

Loading…
Cancel
Save