misc(router): remove SchedulingError

This commit is contained in:
Morgan Funtowicz 2024-10-21 14:57:19 +02:00
parent e6da212431
commit 1a3da05f34
2 changed files with 2 additions and 4 deletions

View File

@ -8,6 +8,7 @@ use hashbrown::HashMap;
use log::warn;
use tokenizers::{Encoding, Tokenizer};
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender};
use tokio::sync::TryAcquireError;
use tokio::task::{spawn_blocking, JoinHandle};
use tokio::time::Instant;
use tokio_stream::wrappers::UnboundedReceiverStream;
@ -121,7 +122,7 @@ fn executor_status_looper(
let what = e.to_string();
error!(error = what.as_str(), "Failed to schedule request");
let err = Err(InferError::SchedulingError(what));
let err = Err(InferError::Overloaded(TryAcquireError::NoPermits));
if let Err(_) = ctx.streamer.send(err) {
error!("Failed to send back error to the client");
}

View File

@ -357,8 +357,6 @@ pub enum InferError {
ToolError(String),
#[error("Stream event serialization error")]
StreamSerializationError(String),
#[error("Scheduling error: {0}")]
SchedulingError(String),
}
impl InferError {
@ -373,7 +371,6 @@ impl InferError {
InferError::MissingTemplateVariable(_) => "missing_template_variable",
InferError::ToolError(_) => "tool_error",
InferError::StreamSerializationError(_) => "stream_serialization_error",
InferError::SchedulingError(_) => "schedling"
}
}
}