chore: update es code to lapin
Signed-off-by: Zomatree <me@zomatree.live>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use revolt_database::Database;
|
||||
use revolt_database::{Database, AMQP};
|
||||
use revolt_result::Result;
|
||||
use tokio::time::sleep;
|
||||
|
||||
pub async fn task(db: Database, _: revolt_database::AMQP) -> Result<()> {
|
||||
pub async fn task(db: Database, amqp: AMQP) -> Result<()> {
|
||||
loop {
|
||||
let accounts = db.fetch_accounts_due_for_deletion().await?;
|
||||
let count = accounts.len();
|
||||
@@ -12,7 +12,7 @@ pub async fn task(db: Database, _: revolt_database::AMQP) -> Result<()> {
|
||||
for mut account in accounts {
|
||||
let mut user = db.fetch_user(&account.id).await?;
|
||||
|
||||
user.delete(&db).await?;
|
||||
user.delete(&db, Some(&amqp)).await?;
|
||||
account.mark_deleted(&db).await?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user