mirror of
https://github.com/simon987/od-database.git
synced 2025-12-13 23:09:01 +00:00
Only queue http tasks (temp)
This commit is contained in:
@@ -309,14 +309,15 @@ class Database:
|
||||
|
||||
conn.commit()
|
||||
|
||||
def get_oldest_updated_websites(self, size: int):
|
||||
def get_oldest_updated_websites(self, size: int, prefix: str):
|
||||
|
||||
with psycopg2.connect(self.db_conn_str) as conn:
|
||||
cursor = conn.cursor()
|
||||
|
||||
cursor.execute("SELECT id, url, last_modified FROM website "
|
||||
"WHERE url LIKE %s "
|
||||
"ORDER BY last_modified ASC LIMIT %s",
|
||||
(size,))
|
||||
(prefix + "%", size, ))
|
||||
return [Website(url=r[1],
|
||||
website_id=r[0],
|
||||
last_modified=r[2],
|
||||
|
||||
Reference in New Issue
Block a user