Skip to content

Commit

Permalink
Attempt to reduce scope of try:except
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaraphael committed Sep 26, 2023
1 parent 3ea36af commit 44e68a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cerulean_cloud/cloud_run_tipg/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import logging
from typing import Any, List, Optional

import asyncpg
import jinja2
import pydantic
from fastapi import FastAPI
Expand Down Expand Up @@ -124,7 +125,9 @@ async def startup_event() -> None:
exclude_functions=db_settings.exclude_functions,
spatial=False, # False means allow non-spatial tables
)
except: # noqa
except asyncpg.exceptions.UndefinedObjectError:
# This is the case where TiPG is attempting to
# start up BEFORE the alembic code has had the opportunity to launch the DB
app.state.collection_catalog = {}


Expand Down

0 comments on commit 44e68a8

Please sign in to comment.