9 lines
354 B
Python
9 lines
354 B
Python
"""Trusted operator only: bound retention of old authentication counters."""
|
|
from app import store
|
|
store.pool.open(wait=True)
|
|
try:
|
|
with store.connect() as conn:
|
|
count=conn.execute("DELETE FROM login_limits WHERE bucket<now()-interval '10 minutes'").rowcount
|
|
print('Removed obsolete rate-limit counters:',count)
|
|
finally:store.pool.close()
|