mirror of
https://github.com/perstarkse/minne.git
synced 2026-03-29 22:01:59 +02:00
feat: surrealdb queue and remove lapin and rabbitmq
This commit is contained in:
@@ -4,6 +4,7 @@ use tracing::info;
|
||||
use crate::{
|
||||
error::{ApiError, AppError},
|
||||
server::AppState,
|
||||
storage::{db::get_all_stored_items, types::job::Job},
|
||||
};
|
||||
|
||||
pub async fn queue_length_handler(
|
||||
@@ -11,11 +12,10 @@ pub async fn queue_length_handler(
|
||||
) -> Result<impl IntoResponse, ApiError> {
|
||||
info!("Getting queue length");
|
||||
|
||||
let queue_length = state
|
||||
.rabbitmq_consumer
|
||||
.get_queue_length()
|
||||
let queue_length = get_all_stored_items::<Job>(&state.surreal_db_client)
|
||||
.await
|
||||
.map_err(AppError::from)?;
|
||||
.map_err(AppError::from)?
|
||||
.len();
|
||||
|
||||
info!("Queue length: {}", queue_length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user