Fix warnings

main
Bob Mottram 2020-05-02 10:19:24 +00:00
parent 1aaeb2cb01
commit 15ba6c3688
3 changed files with 9 additions and 9 deletions

View File

@ -816,8 +816,8 @@ class PubServer(BaseHTTPRequestHandler):
print('Queue: Inbox queue is full')
self._503()
self.server.POSTbusy = False
if not restartInboxQueueInProgress:
self.server.restartInboxQueue=True
if not self.server.restartInboxQueueInProgress:
self.server.restartInboxQueue = True
return 2
# Convert the headers needed for signature verification to dict
@ -7268,8 +7268,8 @@ def runDaemon(blogsInstance: bool, mediaInstance: bool,
args=(baseDir, httpd, 20), daemon=True)
# flags used when restarting the inbox queue
httpd.restartInboxQueueInProgress=False
httpd.restartInboxQueue=False
httpd.restartInboxQueueInProgress = False
httpd.restartInboxQueue = False
if not unitTest:
print('Creating inbox queue watchdog')

4
git.py
View File

@ -14,7 +14,7 @@ def extractPatch(baseDir: str, nickname: str, domain: str,
"""Is the given post content a git patch?
"""
# must have a subject line
if not subject:
if not subject:
return False
if '[PATCH]' not in content:
return False
@ -48,7 +48,7 @@ def extractPatch(baseDir: str, nickname: str, domain: str,
for line in patchLines:
if line.startswith('Subject:'):
patchSubject = \
line.replace('Subject:','').replace('/','|').strip()
line.replace('Subject:', '').replace('/', '|').strip()
patchDir = \
baseDir + '/accounts/' + nickname + '@' + domain + \
'/patches/' + projectName

View File

@ -2186,14 +2186,14 @@ def runInboxQueueWatchdog(projectVersion: str, httpd) -> None:
while True:
time.sleep(20)
if not httpd.thrInboxQueue.isAlive() or httpd.restartInboxQueue:
httpd.restartInboxQueueInProgress=True
httpd.restartInboxQueueInProgress = True
httpd.thrInboxQueue.kill()
httpd.thrInboxQueue = inboxQueueOriginal.clone(runInboxQueue)
httpd.inboxQueue.clear()
httpd.thrInboxQueue.start()
print('Restarting inbox queue...')
httpd.restartInboxQueueInProgress=False
httpd.restartInboxQueue=False
httpd.restartInboxQueueInProgress = False
httpd.restartInboxQueue = False
def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,