Overwrite document on re-index, update website last_modified on task complete, delete website files on index complete

This commit is contained in:
Simon
2018-06-19 11:24:28 -04:00
parent 8486555426
commit e54609972c
5 changed files with 59 additions and 4 deletions

View File

@@ -45,6 +45,14 @@ class Database:
conn.executescript(init_script)
conn.commit()
def update_website_date_if_exists(self, website_id):
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute("UPDATE Website SET last_modified=CURRENT_TIMESTAMP WHERE id=?", (website_id, ))
conn.commit()
def insert_website(self, website: Website):
with sqlite3.connect(self.db_path) as conn: