forked from indymedia/epicyon
Extra param
parent
97665c08cb
commit
fe135682c5
33
daemon.py
33
daemon.py
|
@ -243,23 +243,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
path.startswith('/accounts'):
|
path.startswith('/accounts'):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _postToOutboxThread(self,messageJson: {}) -> bool:
|
|
||||||
"""Creates a thread to send a post
|
|
||||||
"""
|
|
||||||
if self.server.outboxThread:
|
|
||||||
print('Waiting for previous outbox thread to end')
|
|
||||||
while self.server.outboxThread.isAlive():
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
print('Creating outbox thread')
|
|
||||||
self.server.outboxThread= \
|
|
||||||
threadWithTrace(target=self._postToOutbox, \
|
|
||||||
args=(messageJson.copy()),daemon=True)
|
|
||||||
print('Starting outbox thread')
|
|
||||||
self.server.outboxThread.start()
|
|
||||||
|
|
||||||
def _postToOutbox(self,messageJson: {}) -> bool:
|
def _postToOutbox(self,messageJson: {},version: str) -> bool:
|
||||||
"""post is received by the outbox
|
"""post is received by the outbox
|
||||||
Client to server message post
|
Client to server message post
|
||||||
https://www.w3.org/TR/activitypub/#client-to-server-outbox-delivery
|
https://www.w3.org/TR/activitypub/#client-to-server-outbox-delivery
|
||||||
|
@ -440,6 +425,22 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.projectVersion)
|
self.server.projectVersion)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def _postToOutboxThread(self,messageJson: {}) -> bool:
|
||||||
|
"""Creates a thread to send a post
|
||||||
|
"""
|
||||||
|
if self.server.outboxThread:
|
||||||
|
print('Waiting for previous outbox thread to end')
|
||||||
|
while self.server.outboxThread.isAlive():
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
print('Creating outbox thread')
|
||||||
|
self.server.outboxThread= \
|
||||||
|
threadWithTrace(target=self._postToOutbox, \
|
||||||
|
args=(messageJson.copy(),__version__),daemon=True)
|
||||||
|
print('Starting outbox thread')
|
||||||
|
self.server.outboxThread.start()
|
||||||
|
return True
|
||||||
|
|
||||||
def _inboxQueueCleardown(self):
|
def _inboxQueueCleardown(self):
|
||||||
""" Check if the queue is full and remove oldest items if it is
|
""" Check if the queue is full and remove oldest items if it is
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue