forked from indymedia/epicyon
Tidying
parent
d89de123f1
commit
d95093810e
10
daemon.py
10
daemon.py
|
@ -425,10 +425,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.projectVersion)
|
self.server.projectVersion)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _updateInboxQueue(self,nickname: str,messageJson: {},messageBytes: str) -> int:
|
def _inboxQueueCleardown(self):
|
||||||
"""Update the inbox queue
|
""" 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:
|
if len(self.server.inboxQueue)>=self.server.maxQueueLength:
|
||||||
print('Inbox queue is full. Removing oldest items.')
|
print('Inbox queue is full. Removing oldest items.')
|
||||||
while len(self.server.inboxQueue) >= self.server.maxQueueLength-4:
|
while len(self.server.inboxQueue) >= self.server.maxQueueLength-4:
|
||||||
|
@ -436,6 +435,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
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)
|
||||||
|
|
||||||
|
def _updateInboxQueue(self,nickname: str,messageJson: {},messageBytes: str) -> int:
|
||||||
|
"""Update the inbox queue
|
||||||
|
"""
|
||||||
|
self._inboxQueueCleardown()
|
||||||
|
|
||||||
# Convert the headers needed for signature verification to dict
|
# Convert the headers needed for signature verification to dict
|
||||||
headersDict={}
|
headersDict={}
|
||||||
|
|
Loading…
Reference in New Issue