diff --git a/src/db.rs b/src/db.rs index 07302e3..4c06261 100644 --- a/src/db.rs +++ b/src/db.rs @@ -102,9 +102,9 @@ impl DatabaseBackend { if let Some(postgres) = self.postgres.as_ref() { sqlx::query( r#" - INSERT INTO item_log (module, name, url, CURRENT_TIMESTAMP) - VALUES ($1, $2, $3) - ON CONFLICT (module, name, url) + INSERT INTO item_log (module, name, url, timestamp) + VALUES ($1, $2, $3, CURRENT_TIMESTAMP) + ON CONFLICT (module, name, url) DO UPDATE SET timestamp = CURRENT_TIMESTAMP "#, ) @@ -165,7 +165,13 @@ impl Database { pub fn insert_url(&self, module: &str, name: &str, url: &str) { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { - self.conn.query(Query::InsertUrl(module.to_string(), name.to_string(), url.to_string())).await; + self.conn + .query(Query::InsertUrl( + module.to_string(), + name.to_string(), + url.to_string(), + )) + .await; }); }