fix time check of timenet api when need sleep after web request.
Signed-off-by: Omar Sánchez Pizarro <omar.sanchez@pistacero.net>
This commit is contained in:
@@ -58,7 +58,6 @@ class timenetManager:
|
||||
return self.get('check/info', {"guid": args.user})
|
||||
|
||||
def sendUpdate(self):
|
||||
self.updateTime()
|
||||
|
||||
if args.pin is None:
|
||||
# if pin is None, prompt for it
|
||||
@@ -87,6 +86,13 @@ class timenetManager:
|
||||
else:
|
||||
typ = args.type
|
||||
|
||||
|
||||
|
||||
response = None
|
||||
if not args.debug:
|
||||
self.addMessage("####HACIENDO CHECK####")
|
||||
sleep(random.randint(0, 230))
|
||||
self.updateTime()
|
||||
data = {
|
||||
"cp": config['user'],
|
||||
"pin": args.pin,
|
||||
@@ -98,11 +104,6 @@ class timenetManager:
|
||||
"c": 1,
|
||||
"geoAccuracy": config['geo']['accuracy']
|
||||
}
|
||||
|
||||
response = None
|
||||
if not args.debug:
|
||||
self.addMessage("####HACIENDO CHECK####")
|
||||
sleep(random.randint(80, 230))
|
||||
response = self.post("check", data, self.headers)
|
||||
else:
|
||||
self.addMessage('Corriendo en modo debug. No se realizará ninguna acción')
|
||||
|
||||
Reference in New Issue
Block a user