Skip to content

Commit cb03300

Browse files
committed
step 4 done.
1 parent a681f33 commit cb03300

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

page_analyzer/app.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,18 @@ def index():
4747
def urls():
4848
conn = get_db_connection()
4949
cur = conn.cursor()
50-
cur.execute('SELECT * FROM urls ORDER BY created_at DESC')
51-
urls = cur.fetchall()
52-
5350
cur.execute('''
5451
SELECT u.id, u.name, u.created_at,
5552
uc.status_code, uc.created_at AS last_check
5653
FROM urls u
5754
LEFT JOIN url_checks uc ON u.id = uc.url_id
58-
WHERE uc.created_at = (
55+
AND uc.created_at = (
5956
SELECT MAX(created_at)
6057
FROM url_checks
6158
WHERE url_id = u.id
6259
)
6360
ORDER BY u.created_at DESC
6461
''')
65-
urls = cur.fetchall()
66-
6762
cur.close()
6863
conn.close()
6964

0 commit comments

Comments
 (0)