Sort bearers by most recent success & fix deploy issue
This commit is contained in:
parent
ff07ddc8ee
commit
e192f9ae2b
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install packages
|
||||
run: npm install -g serverless
|
||||
run: npm install -g serverless@3.25.1
|
||||
|
||||
- name: Install serverless-wsgi
|
||||
run: serverless plugin install -n serverless-wsgi
|
||||
|
@ -57,6 +57,11 @@ def cycleBearerTokenGet(url,headers):
|
||||
# try another bearer token
|
||||
print(f"Error 429 but {rateLimitRemaining} remaining")
|
||||
continue
|
||||
else:
|
||||
# move successful token to the front if it's not already there
|
||||
if token != bearerTokens[0]:
|
||||
bearerTokens.insert(0,bearerTokens.pop(bearerTokens.index(token)))
|
||||
return tweet
|
||||
except Exception as e:
|
||||
pass
|
||||
return tweet
|
||||
|
Loading…
x
Reference in New Issue
Block a user