From 4b68f1b43776be34065ae9648af8501ef0009bc2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 30 Jun 2019 14:42:45 +0100 Subject: [PATCH] Use loop --- posts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts.py b/posts.py index 58d110ce..5711383b 100644 --- a/posts.py +++ b/posts.py @@ -357,7 +357,7 @@ def sendPost(session,username: str, domain: str, toUsername: str, toDomain: str, signatureHeader['Content-type'] = 'application/json' # Keep the number of threads being used small - if len(sendThreads)>10: + while len(sendThreads)>10: sendThreads[0].stop() sendThreads.pop(0) thr = threading.Thread(target=threadSendPost,args=(session,postJsonObject.copy(),federationList,inboxUrl,signatureHeader.copy()),daemon=True)