mirror of https://gitlab.com/bashrc2/epicyon
is_alive replaces isAlive
parent
347626fd8a
commit
bb31ce37cd
|
@ -1012,7 +1012,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('Waiting for previous outbox thread to end')
|
print('Waiting for previous outbox thread to end')
|
||||||
waitCtr = 0
|
waitCtr = 0
|
||||||
thName = accountOutboxThreadName
|
thName = accountOutboxThreadName
|
||||||
while self.server.outboxThread[thName].isAlive() and waitCtr < 8:
|
while self.server.outboxThread[thName].is_alive() and waitCtr < 8:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
waitCtr += 1
|
waitCtr += 1
|
||||||
if waitCtr >= 8:
|
if waitCtr >= 8:
|
||||||
|
@ -12087,7 +12087,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.server.newPostThread.get(newPostThreadName):
|
if self.server.newPostThread.get(newPostThreadName):
|
||||||
print('Waiting for previous new post thread to end')
|
print('Waiting for previous new post thread to end')
|
||||||
waitCtr = 0
|
waitCtr = 0
|
||||||
while (self.server.newPostThread[newPostThreadName].isAlive() and
|
while (self.server.newPostThread[newPostThreadName].is_alive() and
|
||||||
waitCtr < 8):
|
waitCtr < 8):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
waitCtr += 1
|
waitCtr += 1
|
||||||
|
@ -13005,7 +13005,7 @@ 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.isAlive():
|
if not httpd.thrPostsQueue.is_alive():
|
||||||
httpd.thrPostsQueue.kill()
|
httpd.thrPostsQueue.kill()
|
||||||
httpd.thrPostsQueue = postsQueueOriginal.clone(runPostsQueue)
|
httpd.thrPostsQueue = postsQueueOriginal.clone(runPostsQueue)
|
||||||
httpd.thrPostsQueue.start()
|
httpd.thrPostsQueue.start()
|
||||||
|
@ -13020,7 +13020,7 @@ 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.isAlive():
|
if not httpd.thrSharesExpire.is_alive():
|
||||||
httpd.thrSharesExpire.kill()
|
httpd.thrSharesExpire.kill()
|
||||||
httpd.thrSharesExpire = sharesExpireOriginal.clone(runSharesExpire)
|
httpd.thrSharesExpire = sharesExpireOriginal.clone(runSharesExpire)
|
||||||
httpd.thrSharesExpire.start()
|
httpd.thrSharesExpire.start()
|
||||||
|
|
2
inbox.py
2
inbox.py
|
@ -2456,7 +2456,7 @@ def runInboxQueueWatchdog(projectVersion: str, httpd) -> None:
|
||||||
httpd.thrInboxQueue.start()
|
httpd.thrInboxQueue.start()
|
||||||
while True:
|
while True:
|
||||||
time.sleep(20)
|
time.sleep(20)
|
||||||
if not httpd.thrInboxQueue.isAlive() or httpd.restartInboxQueue:
|
if not httpd.thrInboxQueue.is_alive() or httpd.restartInboxQueue:
|
||||||
httpd.restartInboxQueueInProgress = True
|
httpd.restartInboxQueueInProgress = True
|
||||||
httpd.thrInboxQueue.kill()
|
httpd.thrInboxQueue.kill()
|
||||||
httpd.thrInboxQueue = inboxQueueOriginal.clone(runInboxQueue)
|
httpd.thrInboxQueue = inboxQueueOriginal.clone(runInboxQueue)
|
||||||
|
|
|
@ -752,7 +752,7 @@ 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.isAlive():
|
if not httpd.thrNewswireDaemon.is_alive():
|
||||||
httpd.thrNewswireDaemon.kill()
|
httpd.thrNewswireDaemon.kill()
|
||||||
httpd.thrNewswireDaemon = \
|
httpd.thrNewswireDaemon = \
|
||||||
newswireOriginal.clone(runNewswireDaemon)
|
newswireOriginal.clone(runNewswireDaemon)
|
||||||
|
|
|
@ -158,7 +158,7 @@ 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.isAlive():
|
if not httpd.thrPostSchedule.is_alive():
|
||||||
httpd.thrPostSchedule.kill()
|
httpd.thrPostSchedule.kill()
|
||||||
httpd.thrPostSchedule = \
|
httpd.thrPostSchedule = \
|
||||||
postScheduleOriginal.clone(runPostSchedule)
|
postScheduleOriginal.clone(runPostSchedule)
|
||||||
|
|
40
tests.py
40
tests.py
|
@ -236,11 +236,11 @@ def testThreads():
|
||||||
args=('test',),
|
args=('test',),
|
||||||
daemon=True)
|
daemon=True)
|
||||||
thr.start()
|
thr.start()
|
||||||
assert thr.isAlive() is True
|
assert thr.is_alive() is True
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
thr.kill()
|
thr.kill()
|
||||||
thr.join()
|
thr.join()
|
||||||
assert thr.isAlive() is False
|
assert thr.is_alive() is False
|
||||||
|
|
||||||
|
|
||||||
def createServerAlice(path: str, domain: str, port: int,
|
def createServerAlice(path: str, domain: str, port: int,
|
||||||
|
@ -462,7 +462,7 @@ def testPostMessageBetweenServers():
|
||||||
|
|
||||||
global thrAlice
|
global thrAlice
|
||||||
if thrAlice:
|
if thrAlice:
|
||||||
while thrAlice.isAlive():
|
while thrAlice.is_alive():
|
||||||
thrAlice.stop()
|
thrAlice.stop()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
thrAlice.kill()
|
thrAlice.kill()
|
||||||
|
@ -476,7 +476,7 @@ def testPostMessageBetweenServers():
|
||||||
|
|
||||||
global thrBob
|
global thrBob
|
||||||
if thrBob:
|
if thrBob:
|
||||||
while thrBob.isAlive():
|
while thrBob.is_alive():
|
||||||
thrBob.stop()
|
thrBob.stop()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
thrBob.kill()
|
thrBob.kill()
|
||||||
|
@ -490,8 +490,8 @@ def testPostMessageBetweenServers():
|
||||||
|
|
||||||
thrAlice.start()
|
thrAlice.start()
|
||||||
thrBob.start()
|
thrBob.start()
|
||||||
assert thrAlice.isAlive() is True
|
assert thrAlice.is_alive() is True
|
||||||
assert thrBob.isAlive() is True
|
assert thrBob.is_alive() is True
|
||||||
|
|
||||||
# wait for both servers to be running
|
# wait for both servers to be running
|
||||||
while not (testServerAliceRunning and testServerBobRunning):
|
while not (testServerAliceRunning and testServerBobRunning):
|
||||||
|
@ -690,11 +690,11 @@ def testPostMessageBetweenServers():
|
||||||
# stop the servers
|
# stop the servers
|
||||||
thrAlice.kill()
|
thrAlice.kill()
|
||||||
thrAlice.join()
|
thrAlice.join()
|
||||||
assert thrAlice.isAlive() is False
|
assert thrAlice.is_alive() is False
|
||||||
|
|
||||||
thrBob.kill()
|
thrBob.kill()
|
||||||
thrBob.join()
|
thrBob.join()
|
||||||
assert thrBob.isAlive() is False
|
assert thrBob.is_alive() is False
|
||||||
|
|
||||||
os.chdir(baseDir)
|
os.chdir(baseDir)
|
||||||
shutil.rmtree(aliceDir)
|
shutil.rmtree(aliceDir)
|
||||||
|
@ -733,7 +733,7 @@ def testFollowBetweenServers():
|
||||||
|
|
||||||
global thrAlice
|
global thrAlice
|
||||||
if thrAlice:
|
if thrAlice:
|
||||||
while thrAlice.isAlive():
|
while thrAlice.is_alive():
|
||||||
thrAlice.stop()
|
thrAlice.stop()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
thrAlice.kill()
|
thrAlice.kill()
|
||||||
|
@ -747,7 +747,7 @@ def testFollowBetweenServers():
|
||||||
|
|
||||||
global thrBob
|
global thrBob
|
||||||
if thrBob:
|
if thrBob:
|
||||||
while thrBob.isAlive():
|
while thrBob.is_alive():
|
||||||
thrBob.stop()
|
thrBob.stop()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
thrBob.kill()
|
thrBob.kill()
|
||||||
|
@ -761,8 +761,8 @@ def testFollowBetweenServers():
|
||||||
|
|
||||||
thrAlice.start()
|
thrAlice.start()
|
||||||
thrBob.start()
|
thrBob.start()
|
||||||
assert thrAlice.isAlive() is True
|
assert thrAlice.is_alive() is True
|
||||||
assert thrBob.isAlive() is True
|
assert thrBob.is_alive() is True
|
||||||
|
|
||||||
# wait for all servers to be running
|
# wait for all servers to be running
|
||||||
ctr = 0
|
ctr = 0
|
||||||
|
@ -862,11 +862,11 @@ def testFollowBetweenServers():
|
||||||
# stop the servers
|
# stop the servers
|
||||||
thrAlice.kill()
|
thrAlice.kill()
|
||||||
thrAlice.join()
|
thrAlice.join()
|
||||||
assert thrAlice.isAlive() is False
|
assert thrAlice.is_alive() is False
|
||||||
|
|
||||||
thrBob.kill()
|
thrBob.kill()
|
||||||
thrBob.join()
|
thrBob.join()
|
||||||
assert thrBob.isAlive() is False
|
assert thrBob.is_alive() is False
|
||||||
|
|
||||||
# queue item removed
|
# queue item removed
|
||||||
time.sleep(4)
|
time.sleep(4)
|
||||||
|
@ -1290,7 +1290,7 @@ def testClientToServer():
|
||||||
|
|
||||||
global thrAlice
|
global thrAlice
|
||||||
if thrAlice:
|
if thrAlice:
|
||||||
while thrAlice.isAlive():
|
while thrAlice.is_alive():
|
||||||
thrAlice.stop()
|
thrAlice.stop()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
thrAlice.kill()
|
thrAlice.kill()
|
||||||
|
@ -1304,7 +1304,7 @@ def testClientToServer():
|
||||||
|
|
||||||
global thrBob
|
global thrBob
|
||||||
if thrBob:
|
if thrBob:
|
||||||
while thrBob.isAlive():
|
while thrBob.is_alive():
|
||||||
thrBob.stop()
|
thrBob.stop()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
thrBob.kill()
|
thrBob.kill()
|
||||||
|
@ -1318,8 +1318,8 @@ def testClientToServer():
|
||||||
|
|
||||||
thrAlice.start()
|
thrAlice.start()
|
||||||
thrBob.start()
|
thrBob.start()
|
||||||
assert thrAlice.isAlive() is True
|
assert thrAlice.is_alive() is True
|
||||||
assert thrBob.isAlive() is True
|
assert thrBob.is_alive() is True
|
||||||
|
|
||||||
# wait for both servers to be running
|
# wait for both servers to be running
|
||||||
ctr = 0
|
ctr = 0
|
||||||
|
@ -1614,11 +1614,11 @@ def testClientToServer():
|
||||||
# stop the servers
|
# stop the servers
|
||||||
thrAlice.kill()
|
thrAlice.kill()
|
||||||
thrAlice.join()
|
thrAlice.join()
|
||||||
assert thrAlice.isAlive() is False
|
assert thrAlice.is_alive() is False
|
||||||
|
|
||||||
thrBob.kill()
|
thrBob.kill()
|
||||||
thrBob.join()
|
thrBob.join()
|
||||||
assert thrBob.isAlive() is False
|
assert thrBob.is_alive() is False
|
||||||
|
|
||||||
os.chdir(baseDir)
|
os.chdir(baseDir)
|
||||||
# shutil.rmtree(aliceDir)
|
# shutil.rmtree(aliceDir)
|
||||||
|
|
Loading…
Reference in New Issue