mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 21:47:02 +00:00
chore: replace async-std with tokio (#813)
Signed-off-by: Zomatree <me@zomatree.live>
This commit is contained in:
@@ -305,6 +305,6 @@ pub async fn worker(db: Database, amqp: AMQP) {
|
||||
}
|
||||
|
||||
// Sleep for an arbitrary amount of time.
|
||||
async_std::task::sleep(Duration::from_secs(1)).await;
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,6 @@ pub async fn worker(db: Database) {
|
||||
}
|
||||
|
||||
// Sleep for an arbitrary amount of time.
|
||||
async_std::task::sleep(Duration::from_secs(1)).await;
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::{Database, AMQP};
|
||||
|
||||
use async_std::task;
|
||||
use tokio::task;
|
||||
use std::time::Instant;
|
||||
|
||||
const WORKER_COUNT: usize = 5;
|
||||
|
||||
@@ -7,11 +7,11 @@ use revolt_config::config;
|
||||
use revolt_result::Result;
|
||||
|
||||
use async_lock::Semaphore;
|
||||
use async_std::task::spawn;
|
||||
use deadqueue::limited::Queue;
|
||||
use once_cell::sync::Lazy;
|
||||
use revolt_models::v0::Embed;
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
use tokio::task::spawn;
|
||||
|
||||
use isahc::prelude::*;
|
||||
|
||||
@@ -159,6 +159,7 @@ pub async fn generate(
|
||||
.await
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.flatten()
|
||||
.collect::<Vec<Embed>>();
|
||||
|
||||
// Prevent database update when no embeds are found.
|
||||
|
||||
Reference in New Issue
Block a user