From c7894448f30e589b5752fb6f9d6e22c25984523e Mon Sep 17 00:00:00 2001
From: Chris Pomeroy <chris.pomeroy@hotmail.com>
Date: Fri, 23 Mar 2018 02:15:34 +0000
Subject: [PATCH] fixed white space issue

---
 aaxConvert.py |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/aaxConvert.py b/aaxConvert.py
index 5ae5d59..25a8614 100755
--- a/aaxConvert.py
+++ b/aaxConvert.py
@@ -7,6 +7,7 @@
 import json
 import requests
 from querysubsonic import findalbumbyname
+from time import sleep
 
 
 # arguments
@@ -138,11 +139,16 @@
 def getcorrectkey(aaxfile):
     hex = filechecksum(aaxfile)
     payload = hex
-    r = requests.post('http://x86-docker01:8080/function/checkkey', payload, verify=False)
-    if r.status_code == 200:
-        key = r.text
-    else: 
-        print('Checkkey function is down please wait')
+    recovery = 3
+    while recovery != 0:
+      r = requests.post('http://x86-docker01:8080/function/checkkey', payload, verify=False, timeout=None)
+      if r.status_code == 200:
+          key = r.text
+          recovery = 0
+      else: 
+          print('Checkkey function is down please wait')
+          recovery = recovery - 1
+          sleep(5)
     return key
 
 for rfile in glob.glob(args.filename):

--
Gitblit v1.10.0