mirror of https://gitlab.com/bashrc2/epicyon
Only send one response
parent
d21b584f78
commit
d8aac0a273
10
daemon.py
10
daemon.py
|
@ -6967,11 +6967,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
queueStatus = \
|
queueStatus = \
|
||||||
self._updateInboxQueue(self.postToNickname,
|
self._updateInboxQueue(self.postToNickname,
|
||||||
messageJson, messageBytes)
|
messageJson, messageBytes)
|
||||||
if queueStatus == 0:
|
|
||||||
self.send_response(200)
|
|
||||||
self.end_headers()
|
|
||||||
self.server.POSTbusy = False
|
|
||||||
return
|
|
||||||
if queueStatus == 1:
|
if queueStatus == 1:
|
||||||
self.send_response(503)
|
self.send_response(503)
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
@ -6992,11 +6987,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('DEBUG: POST to shared inbox')
|
print('DEBUG: POST to shared inbox')
|
||||||
queueStatus = \
|
queueStatus = \
|
||||||
self._updateInboxQueue('inbox', messageJson, messageBytes)
|
self._updateInboxQueue('inbox', messageJson, messageBytes)
|
||||||
if queueStatus == 0:
|
|
||||||
self.send_response(200)
|
|
||||||
self.end_headers()
|
|
||||||
self.server.POSTbusy = False
|
|
||||||
return
|
|
||||||
elif queueStatus == 1:
|
elif queueStatus == 1:
|
||||||
self.send_response(503)
|
self.send_response(503)
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
|
4
inbox.py
4
inbox.py
|
@ -2238,8 +2238,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
# heartbeat to monitor whether the inbox queue is running
|
# heartbeat to monitor whether the inbox queue is running
|
||||||
heartBeatCtr += 5
|
heartBeatCtr += 5
|
||||||
if heartBeatCtr >= 10:
|
if heartBeatCtr >= 10:
|
||||||
print('>>> Heartbeat Q:' +
|
print('>>> Heartbeat Q:' + str(len(queue)) + ' ' +
|
||||||
str(len(queue)) + ' ' +
|
|
||||||
'{:%F %T}'.format(datetime.datetime.now()))
|
'{:%F %T}'.format(datetime.datetime.now()))
|
||||||
heartBeatCtr = 0
|
heartBeatCtr = 0
|
||||||
|
|
||||||
|
@ -2250,6 +2249,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
queueRestoreCtr = 0
|
queueRestoreCtr = 0
|
||||||
restoreQueueItems(baseDir, queue)
|
restoreQueueItems(baseDir, queue)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
currTime = int(time.time())
|
currTime = int(time.time())
|
||||||
|
|
||||||
# recreate the session periodically
|
# recreate the session periodically
|
||||||
|
|
Loading…
Reference in New Issue