Add a timeout between requests to get a key
This commit is contained in:
parent
7747ea7d9f
commit
f41b79b647
4
main.py
4
main.py
@ -3,6 +3,7 @@
|
||||
__author__ = 'MOIS3Y'
|
||||
|
||||
import requests
|
||||
from time import sleep
|
||||
from models_vm import VmAccount
|
||||
from models_dci import AuthUser
|
||||
from settings import CLIENT_HOST, PLATFORM
|
||||
@ -82,9 +83,10 @@ class Access(object):
|
||||
answer = req.json()
|
||||
key = answer['key']
|
||||
print("Key will be used:")
|
||||
print(key, "\n")
|
||||
print(answer, "\n")
|
||||
break
|
||||
except Exception:
|
||||
sleep(2)
|
||||
check_key += 1
|
||||
key = 'not_found_try_again'
|
||||
return key
|
||||
|
Loading…
Reference in New Issue
Block a user