Add BatchReason::TaskKindCannotBeBatched

This commit is contained in:
Louis Dureuil 2025-04-15 14:58:08 +02:00
parent b73660fa8e
commit f8ff91ed30
No known key found for this signature in database

View File

@ -683,6 +683,9 @@ pub enum BatchStopReason {
kind: Kind, kind: Kind,
id: TaskId, id: TaskId,
}, },
TaskKindCannotBeBatched {
kind: Kind,
},
ExhaustedEnqueuedTasks, ExhaustedEnqueuedTasks,
ExhaustedEnqueuedTasksForIndex { ExhaustedEnqueuedTasksForIndex {
index: String, index: String,
@ -742,6 +745,9 @@ impl Display for BatchStopReason {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
BatchStopReason::Unspecified => f.write_str("unspecified"), BatchStopReason::Unspecified => f.write_str("unspecified"),
BatchStopReason::TaskKindCannotBeBatched { kind } => {
write!(f, "a batch of tasks of type `{kind}` cannot be batched with any other type of task")
}
BatchStopReason::TaskCannotBeBatched { kind, id } => { BatchStopReason::TaskCannotBeBatched { kind, id } => {
write!(f, "task with id {id} of type `{kind}` cannot be batched") write!(f, "task with id {id} of type `{kind}` cannot be batched")
} }