From d8aac0a2733c7595259463a6c537df7e125d86e2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 16 Apr 2020 11:14:05 +0100 Subject: [PATCH] Only send one response --- daemon.py | 10 ---------- inbox.py | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/daemon.py b/daemon.py index 93f874e2a..7b1824b57 100644 --- a/daemon.py +++ b/daemon.py @@ -6967,11 +6967,6 @@ class PubServer(BaseHTTPRequestHandler): queueStatus = \ self._updateInboxQueue(self.postToNickname, messageJson, messageBytes) - if queueStatus == 0: - self.send_response(200) - self.end_headers() - self.server.POSTbusy = False - return if queueStatus == 1: self.send_response(503) self.end_headers() @@ -6992,11 +6987,6 @@ class PubServer(BaseHTTPRequestHandler): print('DEBUG: POST to shared inbox') queueStatus = \ self._updateInboxQueue('inbox', messageJson, messageBytes) - if queueStatus == 0: - self.send_response(200) - self.end_headers() - self.server.POSTbusy = False - return elif queueStatus == 1: self.send_response(503) self.end_headers() diff --git a/inbox.py b/inbox.py index 3799ed362..af961a8f7 100644 --- a/inbox.py +++ b/inbox.py @@ -2238,8 +2238,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, # heartbeat to monitor whether the inbox queue is running heartBeatCtr += 5 if heartBeatCtr >= 10: - print('>>> Heartbeat Q:' + - str(len(queue)) + ' ' + + print('>>> Heartbeat Q:' + str(len(queue)) + ' ' + '{:%F %T}'.format(datetime.datetime.now())) heartBeatCtr = 0 @@ -2250,6 +2249,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, queueRestoreCtr = 0 restoreQueueItems(baseDir, queue) continue + currTime = int(time.time()) # recreate the session periodically