File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 4747userByRestIdGraphql_api = "8r5oa_2vD0WkhIAOkY4TTA"
4848
4949twitterUrl = "x.com" # doubt this will change but just in case
50+
51+ simultaneousRequests = int (os .getenv ("VXTWITTER_SIMULTANEOUS_REQUESTS" ,1 ))
52+
5053class TwExtractError (Exception ):
5154 def __init__ (self , code , message ):
5255 self .code = code
@@ -65,7 +68,7 @@ def try_token(token):
6568 except Exception as e :
6669 return {'success' : False , 'error' : str (e )}
6770
68- with concurrent .futures .ThreadPoolExecutor (max_workers = min (2 , len (tokens ))) as executor :
71+ with concurrent .futures .ThreadPoolExecutor (max_workers = min (simultaneousRequests , len (tokens ))) as executor :
6972 futures = {executor .submit (try_token , token ): token for token in tokens }
7073 for future in concurrent .futures .as_completed (futures ):
7174 result = future .result ()
You can’t perform that action at this time.
0 commit comments