Zero values disable quotas

master
Bob Mottram 2019-07-15 11:25:13 +01:00
parent ce6a60e66e
commit 1b3e381bfc
1 changed files with 19 additions and 16 deletions

View File

@ -876,6 +876,7 @@ def runInboxQueue(baseDir: str,httpPrefix: str,sendThreads: [],postLog: [], \
# limit the number of posts which can arrive per domain per day
postDomain=queueJson['postDomain']
if postDomain:
if domainMaxPostsPerDay>0:
if quotas['domains'].get(postDomain):
if quotas['domains'][postDomain]>domainMaxPostsPerDay:
queue.pop(0)
@ -884,6 +885,7 @@ def runInboxQueue(baseDir: str,httpPrefix: str,sendThreads: [],postLog: [], \
else:
quotas['domains'][postDomain]=1
if accountMaxPostsPerDay>0:
postHandle=queueJson['postNickname']+'@'+postDomain
if quotas['accounts'].get(postHandle):
if quotas['accounts'][postHandle]>accountMaxPostsPerDay:
@ -894,6 +896,7 @@ def runInboxQueue(baseDir: str,httpPrefix: str,sendThreads: [],postLog: [], \
quotas['accounts'][postHandle]=1
if debug:
if accountMaxPostsPerDay>0 or domainMaxPostsPerDay>0:
pprint(quotas)
# Try a few times to obtain the public key