mirror of https://gitlab.com/bashrc2/epicyon
Minimum per minute quotas
parent
36267ac5f4
commit
2f46c2b31f
4
inbox.py
4
inbox.py
|
@ -2138,6 +2138,8 @@ def runInboxQueue(recentPostsCache: {},maxRecentPosts: int, \
|
|||
|
||||
if quotasPerMin['domains'].get(postDomain):
|
||||
domainMaxPostsPerMin=int(domainMaxPostsPerDay/(24*60))
|
||||
if domainMaxPostsPerMin<10:
|
||||
domainMaxPostsPerMin=10
|
||||
if quotasPerMin['domains'][postDomain]>domainMaxPostsPerMin:
|
||||
print('DEBUG: Quota per min - Maximum posts for '+postDomain+' reached ('+str(domainMaxPostsPerMin)+')')
|
||||
if len(queue)>0:
|
||||
|
@ -2169,6 +2171,8 @@ def runInboxQueue(recentPostsCache: {},maxRecentPosts: int, \
|
|||
|
||||
if quotasPerMin['accounts'].get(postHandle):
|
||||
accountMaxPostsPerMin=int(accountMaxPostsPerDay/(24*60))
|
||||
if accountMaxPostsPerMin<10:
|
||||
accountMaxPostsPerMin=10
|
||||
if quotasPerMin['accounts'][postHandle]>accountMaxPostsPerMin:
|
||||
print('DEBUG: Quota account posts per min - Maximum posts for '+postHandle+' reached ('+str(accountMaxPostsPerMin)+')')
|
||||
if len(queue)>0:
|
||||
|
|
2
tests.py
2
tests.py
|
@ -577,7 +577,7 @@ def testPostMessageBetweenServers():
|
|||
outboxAfterAnnounceCount=len([name for name in os.listdir(outboxPath) if os.path.isfile(os.path.join(outboxPath, name))])
|
||||
print('inbox items after announce: '+str(afterAnnounceCount))
|
||||
print('outbox items after announce: '+str(outboxAfterAnnounceCount))
|
||||
#assert afterAnnounceCount==beforeAnnounceCount+1
|
||||
assert afterAnnounceCount==beforeAnnounceCount+1
|
||||
assert outboxAfterAnnounceCount==outboxBeforeAnnounceCount+1
|
||||
# stop the servers
|
||||
thrAlice.kill()
|
||||
|
|
Loading…
Reference in New Issue