Merge pull request #14 from prokrypt/patch-3

store.py: fix timezone derp
This commit is contained in:
Pablo Revilla
2025-03-24 09:07:38 -07:00
committed by GitHub

View File

@@ -228,7 +228,7 @@ async def get_top_traffic_nodes():
ON
p.from_node_id = n.node_id
WHERE
p.import_time >= DATETIME('now', '-1 day')
p.import_time >= DATETIME('now', 'localtime', '-1 day')
GROUP BY
n.long_name, n.role
ORDER BY
@@ -249,7 +249,7 @@ async def get_node_traffic(node_id: int):
FROM packet
JOIN node ON packet.from_node_id = node.node_id OR packet.to_node_id = node.node_id
WHERE node.node_id = :node_id
AND packet.import_time >= DATETIME('now', '-1 day')
AND packet.import_time >= DATETIME('now', 'localtime', '-1 day')
GROUP BY packet.portnum
ORDER BY packet_count DESC;
"""), {"node_id": node_id}