Commit 9d50a4a5 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Replace record set drupal id with memobase id in header.

parent 9f76cd42
Pipeline #26166 passed with stages
in 2 minutes and 3 seconds
......@@ -223,9 +223,9 @@ class UpdateRecordSet(Resource):
return self.send_message(result_topic_value, record_set_id)
def send_message(self, result_topic_value, record_set_id):
def send_message(self, result_topic_value, record_set_drupal_id):
headers = [
('recordSetId', bytes(record_set_id, encoding='utf-8')),
('recordSetId', bytes(result_topic_value.get('field_memobase_id'), encoding='utf-8')),
('sessionId', bytes(str(uuid.uuid4()), encoding='utf-8')),
('institutionId', bytes('none', encoding='utf-8')),
('isPublished', bytes(str(result_topic_value['status']), encoding='utf-8'))
......@@ -239,7 +239,7 @@ class UpdateRecordSet(Resource):
key=key, headers=headers)
except KafkaTimeoutError as ex:
msg = f'KafkaTimeoutError ({record_set_id}): {ex}.'
msg = f'KafkaTimeoutError ({record_set_drupal_id}): {ex}.'
current_app.logger.error(msg)
return {
'status': 'FAILURE',
......@@ -249,7 +249,7 @@ class UpdateRecordSet(Resource):
}, 503
except Exception as ex:
msg = f'Could not import {result_topic_value.get("field_memobase_id")} ' \
f'(Drupal UUID: {record_set_id}) (Unknown Exception): ' + str(ex)
f'(Drupal UUID: {record_set_drupal_id}) (Unknown Exception): ' + str(ex)
current_app.logger.error(f"{msg}\n{traceback.format_exc()}")
return {
'status': 'FAILURE',
......@@ -258,7 +258,7 @@ class UpdateRecordSet(Resource):
'exception': msg
}, 503
current_app.logger.debug('success for ' + record_set_id)
current_app.logger.debug('success for ' + record_set_drupal_id)
return {
'status': 'SUCCESS',
'topic_key': result_topic_value.get('field_memobase_id'),
......
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