Remove stat table
This commit is contained in:
@ -445,30 +445,9 @@ WHERE
|
||||
};
|
||||
|
||||
error!("[Reminder {}] {}", self.id, message);
|
||||
|
||||
if *LOG_TO_DATABASE {
|
||||
sqlx::query!(
|
||||
"INSERT INTO stat (type, reminder_id, message) VALUES ('reminder_failed', ?, ?)",
|
||||
self.id,
|
||||
message,
|
||||
)
|
||||
.execute(pool)
|
||||
.await
|
||||
.expect("Could not log error to database");
|
||||
}
|
||||
}
|
||||
|
||||
async fn log_success(&self, pool: impl Executor<'_, Database = Database> + Copy) {
|
||||
if *LOG_TO_DATABASE {
|
||||
sqlx::query!(
|
||||
"INSERT INTO stat (type, reminder_id) VALUES ('reminder_sent', ?)",
|
||||
self.id,
|
||||
)
|
||||
.execute(pool)
|
||||
.await
|
||||
.expect("Could not log success to database");
|
||||
}
|
||||
}
|
||||
async fn log_success(&self, pool: impl Executor<'_, Database = Database> + Copy) {}
|
||||
|
||||
async fn set_sent(&self, pool: impl Executor<'_, Database = Database> + Copy) {
|
||||
sqlx::query!("UPDATE reminders SET `status` = 'sent' WHERE `id` = ?", self.id)
|
||||
|
Reference in New Issue
Block a user