Report how long inbox cleadown took

main
Bob Mottram 2019-11-15 22:28:40 +00:00
parent 3e368b26e7
commit ee8679a731
1 changed files with 3 additions and 0 deletions

View File

@ -732,11 +732,14 @@ class PubServer(BaseHTTPRequestHandler):
""" """
if len(self.server.inboxQueue)>=self.server.maxQueueLength: if len(self.server.inboxQueue)>=self.server.maxQueueLength:
print('Inbox queue is full. Removing oldest items.') print('Inbox queue is full. Removing oldest items.')
cleardownStartTime=time.time()
while len(self.server.inboxQueue) >= self.server.maxQueueLength-4: while len(self.server.inboxQueue) >= self.server.maxQueueLength-4:
queueFilename=self.server.inboxQueue[0] queueFilename=self.server.inboxQueue[0]
if os.path.isfile(queueFilename): if os.path.isfile(queueFilename):
os.remove(queueFilename) os.remove(queueFilename)
self.server.inboxQueue.pop(0) self.server.inboxQueue.pop(0)
timeDiff=str(int((time.time()-cleardownStartTime)*1000))
print('Inbox cleardown took '+timeDiff+' mS')
def _updateInboxQueue(self,nickname: str,messageJson: {}, \ def _updateInboxQueue(self,nickname: str,messageJson: {}, \
messageBytes: str) -> int: messageBytes: str) -> int: