File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,19 +71,19 @@ end = struct
7171 let attempt = function
7272 | None -> true
7373 | RL rl ->
74- (* inspired from ahrefskit *)
7574 let now = Time. now() in
7675 if Queue. length rl.backlog < rl.max then (
77- Queue. push now rl.backlog;
76+ Queue. push ( now +. rl.period) rl.backlog;
7877 true
79- ) else match Queue. peek rl.backlog with
80- | ts when ts < now -. rl.period ->
81- ignore (Queue. pop rl.backlog : Time.t );
82- Queue. push now rl.backlog;
83- true
84- | _ ->
85- rl.count_silenced < - 1 + rl.count_silenced;
86- false
78+ ) else if Queue. peek rl.backlog < now then (
79+ (* first deadline is past, this attempt succeeds *)
80+ ignore (Queue. pop rl.backlog : Time.t );
81+ Queue. push (now +. rl.period) rl.backlog;
82+ true
83+ ) else (
84+ rl.count_silenced < - 1 + rl.count_silenced;
85+ false
86+ )
8787end
8888
8989(* * Global logger state *)
You can’t perform that action at this time.
0 commit comments