Skip to content

Commit

Permalink
Merge pull request #597 from mapswipe/fix-get-recent-projects
Browse files Browse the repository at this point in the history
query mapping_sessions table instead of results table
  • Loading branch information
Hagellach37 committed Nov 25, 2022
2 parents 835f113 + e75193b commit b2ea4b2
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ def get_recent_projects(hours: int = 3):
pg_db = auth.postgresDB()
query_insert_results = """
select project_id
from results
-- Using timestamp attribute here which is set for all projects
-- and also represents the start_time for newer projects.
-- "Old" projects have no start_time attribute.
-- There is an index defined on "timestamp".
where "timestamp" >= %(timestamp)s
from mapping_sessions
where start_time >= %(timestamp)s
group by project_id
"""
timestamp = (dt.datetime.utcnow() - dt.timedelta(hours=hours)).isoformat()[
Expand Down

0 comments on commit b2ea4b2

Please sign in to comment.