started the status queue development #4

Merged
dafo5502 merged 4 commits from developer into master 2021-10-27 10:00:53 +02:00
Showing only changes of commit 5e2b0e0467 - Show all commits

View File

@ -19,6 +19,7 @@ def create_app():
config.read(os.path.join(app.root_path, 'config.ini'))
queuedir = os.path.join(app.root_path, 'queue')
errordir = os.path.join(app.root_path,'error')
storagedir = os.path.join(app.root_path, 'storage')
app.logger.setLevel(config['api'].get('log_level', 'ERROR'))
authenticator = Authenticator(config, app.logger)
@ -120,7 +121,7 @@ def create_app():
content_type='application/json')
@app.route('/status/queue', methods=['GET'])
def status_queueu():
def status_queue():
os_queue_list = os.listdir(queuedir)
queue_list = []
@ -138,6 +139,11 @@ def create_app():
'created': data['data']['created'],
'uploaded': os.path.getctime(path)}
any_errors = os.listdir(errordir)
if item in any_errors:
with open(os.path.join(errordir, item), 'r') as e:
error_item = json.load(e)
mydata['error'] = error_item['error']
queue_list.append(mydata)
return Response(response=json.dumps(queue_list),