Skip to content
Snippets Groups Projects
Commit b8197100 authored by Petitminion's avatar Petitminion
Browse files

fix last domain query

parent dfea89a1
Branches
No related tags found
No related merge requests found
Pipeline #37647 passed with warnings
......@@ -193,8 +193,8 @@ class DB:
) as cursor:
# await cursor.execute("SELECT name FROM domains")
await cursor.execute(
"SELECT domain, MIN(time) AS earliest_time FROM checks \
GROUP BY domain ORDER BY earliest_time ASC LIMIT 20; "
"SELECT domain, MAX(time) AS last_time FROM checks GROUP BY domain \
ORDER BY last_time ASC LIMIT 20;"
)
domains = list(await cursor.fetchall())
domains = [{"name": row["domain"]} for row in domains]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment