feat: use bulk indexing for existing messages

Signed-off-by: Zomatree <me@zomatree.live>
This commit is contained in:
Zomatree
2026-03-21 06:59:56 +00:00
parent 3fd170a7de
commit fb487130c8
3 changed files with 58 additions and 14 deletions

View File

@@ -7,7 +7,7 @@ use amqprs::{
consumer::AsyncConsumer,
};
use revolt_config::{Settings, config, configure};
use revolt_database::{AMQP, DatabaseInfo};
use revolt_database::DatabaseInfo;
use revolt_search::ElasticsearchClient;
use tokio::{signal::ctrl_c, spawn};
@@ -88,8 +88,7 @@ async fn _main() {
let mut task = None;
if std::env::var("INDEX_ALL_MESSAGES").as_deref().is_ok_and(|v| v == "1") {
let amqp = AMQP::new_auto().await;
task = Some(spawn(index::index_existing_messages(db, amqp)));
task = Some(spawn(index::index_existing_messages(db, client.clone())));
}
ctrl_c().await.expect("Failed to wait for ctrl-c");