Less indentation

merge-requests/30/head
Bob Mottram 2021-06-05 13:43:57 +01:00
parent 74f2103cc7
commit 1fba7b1b37
3 changed files with 26 additions and 22 deletions

View File

@ -14902,11 +14902,12 @@ def runPostsWatchdog(projectVersion: str, httpd) -> None:
httpd.thrPostsQueue.start() httpd.thrPostsQueue.start()
while True: while True:
time.sleep(20) time.sleep(20)
if not httpd.thrPostsQueue.is_alive(): if httpd.thrPostsQueue.is_alive():
httpd.thrPostsQueue.kill() continue
httpd.thrPostsQueue = postsQueueOriginal.clone(runPostsQueue) httpd.thrPostsQueue.kill()
httpd.thrPostsQueue.start() httpd.thrPostsQueue = postsQueueOriginal.clone(runPostsQueue)
print('Restarting posts queue...') httpd.thrPostsQueue.start()
print('Restarting posts queue...')
def runSharesExpireWatchdog(projectVersion: str, httpd) -> None: def runSharesExpireWatchdog(projectVersion: str, httpd) -> None:
@ -14917,11 +14918,12 @@ def runSharesExpireWatchdog(projectVersion: str, httpd) -> None:
httpd.thrSharesExpire.start() httpd.thrSharesExpire.start()
while True: while True:
time.sleep(20) time.sleep(20)
if not httpd.thrSharesExpire.is_alive(): if httpd.thrSharesExpire.is_alive():
httpd.thrSharesExpire.kill() continue
httpd.thrSharesExpire = sharesExpireOriginal.clone(runSharesExpire) httpd.thrSharesExpire.kill()
httpd.thrSharesExpire.start() httpd.thrSharesExpire = sharesExpireOriginal.clone(runSharesExpire)
print('Restarting shares expiry...') httpd.thrSharesExpire.start()
print('Restarting shares expiry...')
def loadTokens(baseDir: str, tokensDict: {}, tokensLookup: {}) -> None: def loadTokens(baseDir: str, tokensDict: {}, tokensLookup: {}) -> None:

View File

@ -750,9 +750,10 @@ def runNewswireWatchdog(projectVersion: str, httpd) -> None:
httpd.thrNewswireDaemon.start() httpd.thrNewswireDaemon.start()
while True: while True:
time.sleep(50) time.sleep(50)
if not httpd.thrNewswireDaemon.is_alive(): if httpd.thrNewswireDaemon.is_alive():
httpd.thrNewswireDaemon.kill() continue
httpd.thrNewswireDaemon = \ httpd.thrNewswireDaemon.kill()
newswireOriginal.clone(runNewswireDaemon) httpd.thrNewswireDaemon = \
httpd.thrNewswireDaemon.start() newswireOriginal.clone(runNewswireDaemon)
print('Restarting newswire daemon...') httpd.thrNewswireDaemon.start()
print('Restarting newswire daemon...')

View File

@ -167,12 +167,13 @@ def runPostScheduleWatchdog(projectVersion: str, httpd) -> None:
httpd.thrPostSchedule.start() httpd.thrPostSchedule.start()
while True: while True:
time.sleep(20) time.sleep(20)
if not httpd.thrPostSchedule.is_alive(): if httpd.thrPostSchedule.is_alive():
httpd.thrPostSchedule.kill() continue
httpd.thrPostSchedule = \ httpd.thrPostSchedule.kill()
postScheduleOriginal.clone(runPostSchedule) httpd.thrPostSchedule = \
httpd.thrPostSchedule.start() postScheduleOriginal.clone(runPostSchedule)
print('Restarting scheduled posts...') httpd.thrPostSchedule.start()
print('Restarting scheduled posts...')
def removeScheduledPosts(baseDir: str, nickname: str, domain: str) -> None: def removeScheduledPosts(baseDir: str, nickname: str, domain: str) -> None: