kopia lustrzana https://github.com/snarfed/bridgy-fed
dms: bug fix for request limit in memcache, use integer seconds expiration
rodzic
52e1a8d867
commit
0f6798389b
2
dms.py
2
dms.py
|
@ -144,7 +144,7 @@ def receive(*, from_user, obj):
|
|||
attempts = memcache.incr(attempts_key, 1)
|
||||
if not attempts:
|
||||
memcache.add(attempts_key, 1,
|
||||
expire=REQUESTS_LIMIT_EXPIRE.total_seconds())
|
||||
expire=int(REQUESTS_LIMIT_EXPIRE.total_seconds()))
|
||||
elif attempts > REQUESTS_LIMIT_USER:
|
||||
return reply(f"Sorry, you've hit your limit of {REQUESTS_LIMIT_USER} requests per day. Try again tomorrow!")
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue