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})
|
return self.get('check/info', {"guid": args.user})
|
||||||
|
|
||||||
def sendUpdate(self):
|
def sendUpdate(self):
|
||||||
self.updateTime()
|
|
||||||
|
|
||||||
if args.pin is None:
|
if args.pin is None:
|
||||||
# if pin is None, prompt for it
|
# if pin is None, prompt for it
|
||||||
@@ -87,6 +86,13 @@ class timenetManager:
|
|||||||
else:
|
else:
|
||||||
typ = args.type
|
typ = args.type
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
response = None
|
||||||
|
if not args.debug:
|
||||||
|
self.addMessage("####HACIENDO CHECK####")
|
||||||
|
sleep(random.randint(0, 230))
|
||||||
|
self.updateTime()
|
||||||
data = {
|
data = {
|
||||||
"cp": config['user'],
|
"cp": config['user'],
|
||||||
"pin": args.pin,
|
"pin": args.pin,
|
||||||
@@ -98,11 +104,6 @@ class timenetManager:
|
|||||||
"c": 1,
|
"c": 1,
|
||||||
"geoAccuracy": config['geo']['accuracy']
|
"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)
|
response = self.post("check", data, self.headers)
|
||||||
else:
|
else:
|
||||||
self.addMessage('Corriendo en modo debug. No se realizará ninguna acción')
|
self.addMessage('Corriendo en modo debug. No se realizará ninguna acción')
|
||||||
|
|||||||
Reference in New Issue
Block a user