master
Bob Mottram 2019-09-03 10:44:50 +01:00
parent d89de123f1
commit d95093810e
1 changed files with 7 additions and 3 deletions

View File

@ -425,10 +425,9 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion)
return True
def _updateInboxQueue(self,nickname: str,messageJson: {},messageBytes: str) -> int:
"""Update the inbox queue
def _inboxQueueCleardown(self):
""" Check if the queue is full and remove oldest items if it is
"""
# Check if the queue is full
if len(self.server.inboxQueue)>=self.server.maxQueueLength:
print('Inbox queue is full. Removing oldest items.')
while len(self.server.inboxQueue) >= self.server.maxQueueLength-4:
@ -436,6 +435,11 @@ class PubServer(BaseHTTPRequestHandler):
if os.path.isfile(queueFilename):
os.remove(queueFilename)
self.server.inboxQueue.pop(0)
def _updateInboxQueue(self,nickname: str,messageJson: {},messageBytes: str) -> int:
"""Update the inbox queue
"""
self._inboxQueueCleardown()
# Convert the headers needed for signature verification to dict
headersDict={}