forked from indymedia/epicyon
Followers threads debug
parent
1a09fa0823
commit
4f1797b046
|
@ -482,6 +482,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
inactiveFollowerThreads.append(th)
|
inactiveFollowerThreads.append(th)
|
||||||
for th in inactiveFollowerThreads:
|
for th in inactiveFollowerThreads:
|
||||||
self.server.followersThreads.remove(th)
|
self.server.followersThreads.remove(th)
|
||||||
|
if self.server.debug:
|
||||||
|
print('DEBUG: '+str(len(self.server.followersThreads))+' followers threads active')
|
||||||
# create a thread to send the post to followers
|
# create a thread to send the post to followers
|
||||||
followersThread= \
|
followersThread= \
|
||||||
sendToFollowersThread(self.server.session, \
|
sendToFollowersThread(self.server.session, \
|
||||||
|
@ -498,8 +500,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
messageJson,self.server.debug, \
|
messageJson,self.server.debug, \
|
||||||
self.server.projectVersion)
|
self.server.projectVersion)
|
||||||
self.server.followersThreads.append(followersThread)
|
self.server.followersThreads.append(followersThread)
|
||||||
# retain up to 10 threads
|
# retain up to 20 threads
|
||||||
if len(self.server.followersThreads)>10:
|
if len(self.server.followersThreads)>20:
|
||||||
for i in range(2):
|
for i in range(2):
|
||||||
# kill the thread if it is still alive
|
# kill the thread if it is still alive
|
||||||
if self.server.followersThreads[0].is_alive():
|
if self.server.followersThreads[0].is_alive():
|
||||||
|
|
Loading…
Reference in New Issue