Queue updates within 30 second to avoid network spam
This commit is contained in:
parent
c8b949cef5
commit
0e13fbf5dc
2 changed files with 25 additions and 4 deletions
|
@ -27,6 +27,12 @@ def isAllowed(event, allowed_again=10):
|
|||
else:
|
||||
return False
|
||||
|
||||
def delayLeft(event, allowed_again=10):
|
||||
last_called = called_db.get(event)
|
||||
if not last_called: # Its not called before
|
||||
return 0
|
||||
else:
|
||||
return allowed_again - (time.time() - last_called)
|
||||
|
||||
def callQueue(event):
|
||||
func, args, kwargs, thread = queue_db[event]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue