X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=webapp%2Fbackend%2Ffireinfo.py;h=4529fea3275a2a5e19acc8f74e5c0117d0dda2c7;hb=191087b67d74ce82e62adfb0d6206179fce0f989;hp=fb946b4c9e677283d904b1aaeb3bdcac85c4ad84;hpb=280ed84e2796e7b985e869da99ebca4443fa7fe9;p=ipfire.org.git diff --git a/webapp/backend/fireinfo.py b/webapp/backend/fireinfo.py index fb946b4c..4529fea3 100644 --- a/webapp/backend/fireinfo.py +++ b/webapp/backend/fireinfo.py @@ -1503,12 +1503,9 @@ class Fireinfo(Object): return False def profile_rate_limit_active(self, public_id, when=None): - # Remove all outdated entries - self.db.execute("DELETE FROM fireinfo_profiles_log \ - WHERE ts <= then_or_now(%s) - INTERVAL '60 minutes'", when) - res = self.db.get("SELECT COUNT(*) AS count FROM fireinfo_profiles_log \ - WHERE public_id = %s", public_id) + WHERE public_id = %s AND ts >= then_or_now(%s) - INTERVAL '60 minutes'", + public_id, when) if res and res.count >= 10: return True