The following code in cloudflare_waf.py does not handle one edge case last_event==intended_end_time && overflown
Add extra logic to start from last_event/intended_end_time, go a few seconds into the future, and insert logs (leaving the DB to handle duplicates)
return LogResult(
# This does not account for the edge case that the last event is exactly at the limit
# TODO(): Add extra logic to check this case
overflown=len(result) == MAX_LOG_LIMIT,
last_event=iso_to_datetime(result[-1].datetime),
intended_end_time=end_time,
)
The following code in
cloudflare_waf.py
does not handle one edge caselast_event==intended_end_time && overflown
Add extra logic to start from
last_event/intended_end_time
, go a few seconds into the future, and insert logs (leaving the DB to handle duplicates)