mirror of
https://github.com/taoensso/telemere.git
synced 2026-01-28 17:10:33 +00:00
[nop] Tune internal handler rate limits
This commit is contained in:
parent
d2b3e7201d
commit
1756069330
2 changed files with 4 additions and 3 deletions
|
|
@ -325,7 +325,7 @@
|
||||||
>max-file-size?
|
>max-file-size?
|
||||||
(when max-file-size
|
(when max-file-size
|
||||||
(let [max-file-size (long max-file-size)
|
(let [max-file-size (long max-file-size)
|
||||||
rl (enc/rate-limiter-once-per 2500)]
|
rl (enc/rate-limiter-once-per 250)]
|
||||||
(fn [] (and (not (rl)) (> (.length main-file) max-file-size)))))
|
(fn [] (and (not (rl)) (> (.length main-file) max-file-size)))))
|
||||||
|
|
||||||
prev-timestamp_ (enc/latom nil) ; Initially nil
|
prev-timestamp_ (enc/latom nil) ; Initially nil
|
||||||
|
|
@ -395,6 +395,7 @@
|
||||||
(.setLastModified (utils/as-file "test/logs/app6.log")
|
(.setLastModified (utils/as-file "test/logs/app6.log")
|
||||||
(enc/as-udt "1999-01-01T01:00:00.00Z"))
|
(enc/as-udt "1999-01-01T01:00:00.00Z"))
|
||||||
|
|
||||||
|
(let [f (utils/as-file "test/logs/app6.log")] (enc/qb 1e5 (.length f)))
|
||||||
(let [hfn
|
(let [hfn
|
||||||
(handler:file
|
(handler:file
|
||||||
{:path "test/logs/app6.log"
|
{:path "test/logs/app6.log"
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@
|
||||||
true))
|
true))
|
||||||
|
|
||||||
file-exists!
|
file-exists!
|
||||||
(let [rl (enc/rate-limiter-once-per 250)]
|
(let [rl (enc/rate-limiter-once-per 100)]
|
||||||
(fn []
|
(fn []
|
||||||
(or (rl) (.exists file)
|
(or (rl) (.exists file)
|
||||||
(throw (java.io.IOException. "File doesn't exist")))))
|
(throw (java.io.IOException. "File doesn't exist")))))
|
||||||
|
|
@ -344,7 +344,7 @@
|
||||||
true))
|
true))
|
||||||
|
|
||||||
conn-okay!
|
conn-okay!
|
||||||
(let [rl (enc/rate-limiter-once-per 250)]
|
(let [rl (enc/rate-limiter-once-per 100)]
|
||||||
(fn []
|
(fn []
|
||||||
(or
|
(or
|
||||||
(rl)
|
(rl)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue