Skip to content

Commit

Permalink
dont show jobs in future
Browse files Browse the repository at this point in the history
  • Loading branch information
btylerburton committed Feb 14, 2025
1 parent 956c68c commit d493921
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,11 @@ def view_harvest_source_data(source_id: str):
"target_div": "#paginated__harvest-jobs",
"endpoint_url": f"/harvest_source/{source_id}",
}

harvest_jobs_facets = (
f"harvest_source_id = '{source_id}' AND date_created <= '{get_datetime()}'"
)
jobs_count = db.pget_harvest_jobs(
facets=f"harvest_source_id = '{source_id}'",
facets=harvest_jobs_facets,
count=True,
)

Expand All @@ -494,7 +496,7 @@ def view_harvest_source_data(source_id: str):

if htmx:
jobs = db.pget_harvest_jobs(
facets=f"harvest_source_id = '{source_id}'",
facets=harvest_jobs_facets,
page=pagination.db_current,
)
data = {
Expand Down Expand Up @@ -526,7 +528,7 @@ def view_harvest_source_data(source_id: str):
}

jobs = db.pget_harvest_jobs(
facets=f"harvest_source_id = '{source_id}'",
facets=harvest_jobs_facets,
page=pagination.db_current,
)

Expand Down Expand Up @@ -937,7 +939,7 @@ def view_metrics():
"""Render index page with recent harvest jobs."""
current_time = get_datetime()
start_time = current_time - timedelta(hours=24)
time_filter = f"date_created >= '{start_time.isoformat()}'"
time_filter = f"date_created >= '{start_time.isoformat()}' AND date_created <= '{current_time}'"

htmx_vars = {
"target_div": "#paginated__harvest-jobs",
Expand Down

1 comment on commit d493921

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title Coverage Tests Skipped Failures Errors Time
Unit tests Coverage 39 0 💤 0 ❌ 0 🔥 0.981s ⏱️
Integration Tests Coverage 74 0 💤 0 ❌ 0 🔥 4.485s ⏱️
Functional Tests Coverage 2 0 💤 0 ❌ 0 🔥 7.353s ⏱️

Please sign in to comment.