From 097c219ee63a28f83f8ccf50849b7f7c9a12f4f4 Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Tue, 14 May 2024 16:30:19 -0700 Subject: [PATCH] Fix up the queue --- auth-api/src/auth_api/__init__.py | 2 -- .../src/auth_api/services/gcp_queue/gcp_queue.py | 12 ++---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/auth-api/src/auth_api/__init__.py b/auth-api/src/auth_api/__init__.py index 0fc7b0c356..3680b12c6d 100644 --- a/auth-api/src/auth_api/__init__.py +++ b/auth-api/src/auth_api/__init__.py @@ -58,8 +58,6 @@ def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): ma.init_app(app) mail.init_app(app) queue.init_app(app) - print('INIT QUEUE') - print(app.config.get('GCP_AUTH_KEY')[1:10]) endpoints.init_app(app) if os.getenv('FLASK_ENV', 'production') != 'testing': diff --git a/auth-api/src/auth_api/services/gcp_queue/gcp_queue.py b/auth-api/src/auth_api/services/gcp_queue/gcp_queue.py index c4a67548a6..7d27cf7c15 100644 --- a/auth-api/src/auth_api/services/gcp_queue/gcp_queue.py +++ b/auth-api/src/auth_api/services/gcp_queue/gcp_queue.py @@ -67,7 +67,6 @@ def __init__(self, app: Flask = None): def init_app(self, app: Flask): """Initialize the application.""" self.gcp_auth_key = app.config.get('GCP_AUTH_KEY') - print(app.config.get('GCP_AUTH_KEY')[0:10]) if self.gcp_auth_key: try: audience = app.config.get( @@ -83,21 +82,14 @@ def init_app(self, app: Flask): credentials = jwt.Credentials.from_service_account_info(self.service_account_info, audience=audience) self.credentials_pub = credentials.with_claims(audience=publisher_audience) except Exception as error: # noqa: B902 - print('error creating connection?') - print(error) raise Exception('Unable to create a connection', error) from error # pylint: disable=W0719 @property def publisher(self): """Returns the publisher.""" - if self.credentials_pub: - print('Choosing credentials') + if not self._publisher and self.credentials_pub: self._publisher = pubsub_v1.PublisherClient(credentials=self.credentials_pub) - else: - print('no cred!') - print(self._publisher) - print(self.credentials_pub) - print(self.gcp_auth_key[0:20]) + if not self._publisher: self._publisher = pubsub_v1.PublisherClient() return self._publisher