Added retry for the Checkkey function
| | |
| | | import json |
| | | import requests |
| | | from querysubsonic import findalbumbyname |
| | | from time import sleep |
| | | |
| | | |
| | | # arguments |
| | |
| | | def getcorrectkey(aaxfile): |
| | | hex = filechecksum(aaxfile) |
| | | payload = hex |
| | | 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): |