Snake case

merge-requests/30/head
Bob Mottram 2021-12-25 22:48:08 +00:00
parent e7af84f3fe
commit 869ba0ccf9
3 changed files with 13 additions and 13 deletions

View File

@ -1284,7 +1284,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.i2p_domain, self.server.i2p_domain,
self.server.port, self.server.port,
self.server.recentPostsCache, self.server.recentPostsCache,
self.server.followersThreads, self.server.followers_threads,
self.server.federationList, self.server.federationList,
self.server.send_threads, self.server.send_threads,
self.server.postLog, self.server.postLog,
@ -18765,7 +18765,7 @@ def runDaemon(content_license_url: str,
loadTokens(base_dir, httpd.tokens, httpd.tokens_lookup) loadTokens(base_dir, httpd.tokens, httpd.tokens_lookup)
httpd.instance_only_skills_search = instance_only_skills_search httpd.instance_only_skills_search = instance_only_skills_search
# contains threads used to send posts to followers # contains threads used to send posts to followers
httpd.followersThreads = [] httpd.followers_threads = []
# create a cache of blocked domains in memory. # create a cache of blocked domains in memory.
# This limits the amount of slow disk reads which need to be done # This limits the amount of slow disk reads which need to be done

View File

@ -182,7 +182,7 @@ def postMessageToOutbox(session, translate: {},
server, base_dir: str, http_prefix: str, server, base_dir: str, http_prefix: str,
domain: str, domainFull: str, domain: str, domainFull: str,
onion_domain: str, i2p_domain: str, port: int, onion_domain: str, i2p_domain: str, port: int,
recentPostsCache: {}, followersThreads: [], recentPostsCache: {}, followers_threads: [],
federationList: [], send_threads: [], federationList: [], send_threads: [],
postLog: [], cached_webfingers: {}, postLog: [], cached_webfingers: {},
person_cache: {}, allow_deletion: bool, person_cache: {}, allow_deletion: bool,
@ -492,21 +492,21 @@ def postMessageToOutbox(session, translate: {},
print('DEBUG: sending c2s post to followers') print('DEBUG: sending c2s post to followers')
# remove inactive threads # remove inactive threads
inactiveFollowerThreads = [] inactiveFollowerThreads = []
for th in followersThreads: for th in followers_threads:
if not th.is_alive(): if not th.is_alive():
inactiveFollowerThreads.append(th) inactiveFollowerThreads.append(th)
for th in inactiveFollowerThreads: for th in inactiveFollowerThreads:
followersThreads.remove(th) followers_threads.remove(th)
if debug: if debug:
print('DEBUG: ' + str(len(followersThreads)) + print('DEBUG: ' + str(len(followers_threads)) +
' followers threads active') ' followers threads active')
# retain up to 200 threads # retain up to 200 threads
if len(followersThreads) > 200: if len(followers_threads) > 200:
# kill the thread if it is still alive # kill the thread if it is still alive
if followersThreads[0].is_alive(): if followers_threads[0].is_alive():
followersThreads[0].kill() followers_threads[0].kill()
# remove it from the list # remove it from the list
followersThreads.pop(0) followers_threads.pop(0)
# create a thread to send the post to followers # create a thread to send the post to followers
followersThread = \ followersThread = \
sendToFollowersThread(server.session, sendToFollowersThread(server.session,
@ -524,7 +524,7 @@ def postMessageToOutbox(session, translate: {},
shared_items_federated_domains, shared_items_federated_domains,
sharedItemFederationTokens, sharedItemFederationTokens,
signingPrivateKeyPem) signingPrivateKeyPem)
followersThreads.append(followersThread) followers_threads.append(followersThread)
if debug: if debug:
print('DEBUG: handle any unfollow requests') print('DEBUG: handle any unfollow requests')
@ -665,5 +665,5 @@ def postMessageToOutbox(session, translate: {},
shared_items_federated_domains, shared_items_federated_domains,
sharedItemFederationTokens, sharedItemFederationTokens,
signingPrivateKeyPem) signingPrivateKeyPem)
followersThreads.append(namedAddressesThread) followers_threads.append(namedAddressesThread)
return True return True

View File

@ -104,7 +104,7 @@ def _updatePostSchedule(base_dir: str, handle: str, httpd,
httpd.i2p_domain, httpd.i2p_domain,
httpd.port, httpd.port,
httpd.recentPostsCache, httpd.recentPostsCache,
httpd.followersThreads, httpd.followers_threads,
httpd.federationList, httpd.federationList,
httpd.send_threads, httpd.send_threads,
httpd.postLog, httpd.postLog,