From 98e189eafb4d022e8e9b30d15fdf7bc0c717026d Mon Sep 17 00:00:00 2001 From: Jason Syrotuck Date: Thu, 7 Nov 2024 13:08:33 -0800 Subject: [PATCH] [FIX] - local tuple syntax (#3297) * data typing issues and clean up * better logging * better logging of errors * list of tuples * add celery decorator * rename var to match envvar --- services/core-api/app/api/verifiable_credentials/manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core-api/app/api/verifiable_credentials/manager.py b/services/core-api/app/api/verifiable_credentials/manager.py index 7116e86280..4f9df4add7 100644 --- a/services/core-api/app/api/verifiable_credentials/manager.py +++ b/services/core-api/app/api/verifiable_credentials/manager.py @@ -226,11 +226,12 @@ def process_all_untp_map_for_orgbook(): return [record for payload, record in records] +@celery.task() def forward_all_pending_untp_vc_to_orgbook(): """STUB for celery job to publis all pending vc to orgbook.""" ## CORE signs and structures the credential, the publisher just validates and forwards it. records_to_forward = PermitAmendmentOrgBookPublish.find_all_unpublished(unsafe=True) - ORGBOOK_W3C_CRED_FORWARD = f"{Config.ORGBOOK_CREDENTIAL_BASE_URL}/forward" + ORGBOOK_W3C_CRED_FORWARD = f"{Config.ORGBOOK_PUBLISHER_BASE_URL}/credentials/forward" task_logger.warning(f"going to publish {len(records_to_forward)} records to orgbook") @@ -321,7 +322,7 @@ def push_untp_map_data_to_publisher(): ) else: success_count += success_count + 1 - failed_credentials.append(publish_record.unsigned_payload_hash, publish_record.error_msg) + failed_credentials.append((publish_record.unsigned_payload_hash, publish_record.error_msg)) return f"num published={success_count}, num failed = {len(failed_credentials)}"