Skip to content

Commit

Permalink
Fix up the queue
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 committed May 14, 2024
1 parent c24dc63 commit 097c219
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 0 additions & 2 deletions auth-api/src/auth_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
12 changes: 2 additions & 10 deletions auth-api/src/auth_api/services/gcp_queue/gcp_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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

Expand Down

0 comments on commit 097c219

Please sign in to comment.