Commit 61e12445 authored by Lionel Walter's avatar Lionel Walter
Browse files

Wait 3s before generating report

parent a7c0a2f4
Pipeline #10782 passed with stages
in 7 minutes and 40 seconds
......@@ -46,6 +46,7 @@ def get_report(topic_name):
except UnboundLocalError:
if 'text-file-validation' in topic_name:
report = 'text-file-validation-report-bug-with-checker'
current_app.logger.debug("Report: " + report)
return {
'status': 'SUCCESS',
'report': report
......@@ -57,6 +58,7 @@ def get_report(topic_name):
if report == '':
report = str(processed)+' records successfully processed'
current_app.logger.debug("Report: "+report)
return {
'status': 'SUCCESS',
'report': report
......@@ -64,6 +66,7 @@ def get_report(topic_name):
else:
report_header = str(processed) + ' records processed\r\n'
report_header += str(succeeded) + ' successful\r\n'
current_app.logger.debug("Report: " + report_header+report)
return {
'status': 'FAILURE',
'report': report_header+report
......
import time
from flask_restful import Resource, reqparse, current_app
from flasgger import swag_from
......@@ -102,12 +104,14 @@ class JobStart(Resource):
except ImportApiError as e:
return {'error': e.message}, 500
# wait before consuming results
time.sleep(3)
try:
report = get_report(job_reporting_topic)
except ImportApiError as e:
return {'error': e.message}, 500
current_app.logger.debug("Report: "+report["report"])
# write report
# todo check if drupalJobLogResultUuid is defined
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment