Due to a scheduled upgrade to version 14.10, GitLab will be unavailabe on Monday 30.05., from 19:00 until 20:00.

Commit 6b982cb8 authored by Lionel Walter's avatar Lionel Walter
Browse files

Apply workaround for the text-file-validation-reporting bug

parent cb4a3b19
Pipeline #10756 failed with stages
in 1 minute and 52 seconds
......@@ -15,6 +15,8 @@ def get_report(topic_name):
bootstrap_servers=current_app.config['kafka-broker-url'],
auto_offset_reset='earliest',
enable_auto_commit=False
# todo maybe add group id ?
# group_id='import-api-report'+topic_name
)
except KafkaError:
message = 'It was not possible to connect to the Kafka broker'
......@@ -41,15 +43,30 @@ def get_report(topic_name):
message = 'It was not possible to consume the Kafka messages'
current_app.logger.error(message)
raise ImportApiError(message)
# todo: fix this problem, seems to be a problem when there is only
# one message in the topic somehow
except UnboundLocalError:
if 'text-file-validation' in topic_name:
report = 'text-file-validation-report-bug-with-checker'
return {
'status': 'SUCCESS',
'report': report
}
else:
message = 'Problem generating the report'
current_app.logger.error(message)
raise ImportApiError(message)
if report == '':
report = 'success'
report = str(processed)+' records successfully processed'
return {
'status': 'SUCCESS',
'report': report
}
else:
report_header = str(processed) + ' records processed\r\n'
report_header += str(succeeded) + ' successful\r\n'
return {
'status': 'FAILURE',
'report': report
'report': report_header+report
}
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