Skip to content

Commit

Permalink
feat: check get_all and get_latest methods return next_check_at
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed Nov 22, 2024
1 parent d58d4af commit 2fd106a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions udata_hydra/db/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def get_latest(
async with pool.acquire() as connection:
q = f"""
SELECT catalog.id as catalog_id, checks.id as check_id,
catalog.status as catalog_status, checks.status as check_status, catalog.deleted as deleted, *
catalog.status as catalog_status, checks.status as check_status, checks.next_check_at as next_check_at, catalog.deleted as deleted, *
FROM checks, catalog
WHERE catalog.{column} = $1
AND checks.id = catalog.last_check
Expand All @@ -75,7 +75,7 @@ async def get_all(cls, url: str | None = None, resource_id: str | None = None) -
async with pool.acquire() as connection:
q = f"""
SELECT catalog.id as catalog_id, checks.id as check_id,
catalog.status as catalog_status, checks.status as check_status, catalog.deleted as deleted, *
catalog.status as catalog_status, checks.status as check_status, checks.next_check_at as next_check_at, catalog.deleted as deleted, *
FROM checks, catalog
WHERE catalog.{column} = $1
AND catalog.{column} = checks.{column}
Expand Down
1 change: 1 addition & 0 deletions udata_hydra/schemas/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CheckSchema(Schema):
error = fields.Str()
dataset_id = fields.Str()
resource_id = fields.UUID()
next_check_at = fields.DateTime()
deleted = fields.Boolean()
parsing_started_at = fields.DateTime()
parsing_finished_at = fields.DateTime()
Expand Down

0 comments on commit 2fd106a

Please sign in to comment.