Skip to content

Commit

Permalink
remove debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloud User committed Aug 21, 2023
1 parent 55be7d7 commit a838a23
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions jinjafx_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,11 @@ def ratelimit(self, remote_addr, n=0, check_only=False):
if key in rtable:
if isinstance(rtable[key], int):
if t > rtable[key]:
log('DEBUG: RATE LIMIT CLEARED')
del rtable[key]

else:
if not check_only:
rtable[key] = min(rtable[key] + rl_duration, t + (rl_duration * 2))
log(f'DEBUG: RATE LIMIT EXTENDED - TIME LEFT = {rtable[key] - t}s')
else:
log(f'DEBUG: RATE LIMIT PENDING - TIME LEFT = {rtable[key] - t}s')
return True

else:
Expand All @@ -185,10 +181,7 @@ def ratelimit(self, remote_addr, n=0, check_only=False):
if key in rtable:
if len(rtable[key]) > rl_rate:
if (rtable[key][-1] - rtable[key][0]) <= rl_limit:
if check_only:
log('DEBUG: THIS SHOULD NEVER HAPPEN')
rtable[key] = t + rl_duration
log(f'DEBUG: RATE LIMIT ACTIVATED to {rtable[key]}')
return True

return False
Expand Down

0 comments on commit a838a23

Please sign in to comment.