forked from indymedia/epicyon
Zero values disable quotas
parent
ce6a60e66e
commit
1b3e381bfc
35
inbox.py
35
inbox.py
|
@ -876,25 +876,28 @@ def runInboxQueue(baseDir: str,httpPrefix: str,sendThreads: [],postLog: [], \
|
||||||
# limit the number of posts which can arrive per domain per day
|
# limit the number of posts which can arrive per domain per day
|
||||||
postDomain=queueJson['postDomain']
|
postDomain=queueJson['postDomain']
|
||||||
if postDomain:
|
if postDomain:
|
||||||
if quotas['domains'].get(postDomain):
|
if domainMaxPostsPerDay>0:
|
||||||
if quotas['domains'][postDomain]>domainMaxPostsPerDay:
|
if quotas['domains'].get(postDomain):
|
||||||
queue.pop(0)
|
if quotas['domains'][postDomain]>domainMaxPostsPerDay:
|
||||||
continue
|
queue.pop(0)
|
||||||
quotas['domains'][postDomain]+=1
|
continue
|
||||||
else:
|
quotas['domains'][postDomain]+=1
|
||||||
quotas['domains'][postDomain]=1
|
else:
|
||||||
|
quotas['domains'][postDomain]=1
|
||||||
|
|
||||||
postHandle=queueJson['postNickname']+'@'+postDomain
|
if accountMaxPostsPerDay>0:
|
||||||
if quotas['accounts'].get(postHandle):
|
postHandle=queueJson['postNickname']+'@'+postDomain
|
||||||
if quotas['accounts'][postHandle]>accountMaxPostsPerDay:
|
if quotas['accounts'].get(postHandle):
|
||||||
queue.pop(0)
|
if quotas['accounts'][postHandle]>accountMaxPostsPerDay:
|
||||||
continue
|
queue.pop(0)
|
||||||
quotas['accounts'][postHandle]+=1
|
continue
|
||||||
else:
|
quotas['accounts'][postHandle]+=1
|
||||||
quotas['accounts'][postHandle]=1
|
else:
|
||||||
|
quotas['accounts'][postHandle]=1
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
pprint(quotas)
|
if accountMaxPostsPerDay>0 or domainMaxPostsPerDay>0:
|
||||||
|
pprint(quotas)
|
||||||
|
|
||||||
# Try a few times to obtain the public key
|
# Try a few times to obtain the public key
|
||||||
pubKey=None
|
pubKey=None
|
||||||
|
|
Loading…
Reference in New Issue