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

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