Skip to content

Commit

Permalink
fix error logging, address potential db error (#3151)
Browse files Browse the repository at this point in the history
  • Loading branch information
bolyachevets authored Nov 21, 2024
1 parent 5678e2a commit 11c27c8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions queue_services/auth-queue/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion queue_services/auth-queue/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pyasn1_modules = "0.4.0"
pycountry = "23.12.11"
pyrsistent = "0.20.0"
python-dateutil = "2.9.0.post0"
pytz = "2024.1"
pytz = "2024.2"
rsa = "4.9"
semver = "3.0.2"
six = "1.16.0"
Expand Down
6 changes: 3 additions & 3 deletions queue_services/auth-queue/src/auth_queue/resources/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def worker():
elif event_message.type in [QueueMessageTypes.NSF_UNLOCK_ACCOUNT.value,
QueueMessageTypes.NSF_LOCK_ACCOUNT.value]:
process_pay_lock_unlock_event(event_message)
except Exception: # NOQA # pylint: disable=broad-except
logger.error('Error processing event:', exc_info=True)
except Exception as e: # NOQA # pylint: disable=broad-except
logger.error('Error processing event: %', str(e))
# Return a 200, so the event is removed from the Queue
return {}, HTTPStatus.OK

Expand Down Expand Up @@ -188,7 +188,7 @@ def process_name_events(event_message: SimpleCloudEvent):
and str(auth_account_id).isnumeric():
logger.info('Account ID received : %s', auth_account_id)
# Auth account id can be service account value too, so doing a query lookup than find_by_id
org: OrgModel = db.session.query(OrgModel).filter(OrgModel.id == auth_account_id).one_or_none()
org: OrgModel = db.session.query(OrgModel).filter(OrgModel.id == int(auth_account_id or -1)).one_or_none()
# If account is present and is not a gov account, then affiliate.
if org and org.access_type != AccessType.GOVM.value:
nr_entity.pass_code_claimed = True
Expand Down

0 comments on commit 11c27c8

Please sign in to comment.