Skip to content

Commit

Permalink
Ugh. Circular dep prevents importing logger into crud versions module.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmannarino committed May 24, 2024
1 parent 9a26e4f commit c4ad2a2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/crud/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from asyncpg import UniqueViolationError

from ..errors import RecordAlreadyExistsError, RecordNotFoundError
from ..main import logger
# from ..main import logger
from ..models.orm.assets import Asset as ORMAsset
from ..models.orm.datasets import Dataset as ORMDataset
from ..models.orm.version_metadata import VersionMetadata as ORMVersionMetadata
Expand Down Expand Up @@ -105,10 +105,10 @@ async def create_version(dataset: str, version: str, **data) -> ORMVersion:
# asset...
if data.get("is_latest"):
await _reset_is_latest(dataset, version)
logger.info(
f"Setting version {version} to latest for dataset {dataset}. "
f"Cache info: {get_latest_version.cache_info()}"
)
# logger.info(
# f"Setting version {version} to latest for dataset {dataset}. "
# f"Cache info: {get_latest_version.cache_info()}"
# )
_: bool = get_latest_version.cache_invalidate(dataset)

return new_version
Expand All @@ -131,10 +131,10 @@ async def update_version(dataset: str, version: str, **data) -> ORMVersion:

if data.get("is_latest"):
await _reset_is_latest(dataset, version)
logger.info(
f"Setting version {version} to latest for dataset {dataset}. "
f"Cache info: {get_latest_version.cache_info()}"
)
# logger.info(
# f"Setting version {version} to latest for dataset {dataset}. "
# f"Cache info: {get_latest_version.cache_info()}"
# )
_: bool = get_latest_version.cache_invalidate(dataset)

return row
Expand Down

0 comments on commit c4ad2a2

Please sign in to comment.