fix(textprocessing): accept scheduling a task if there are equivalent taskprocessing providers only

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
pull/49260/head
Julien Veyssier 2024-11-13 16:59:46 +07:00
parent 22e2419b28
commit a52a63fc74
No known key found for this signature in database
GPG Key ID: 4141FEE162030638
1 changed files with 5 additions and 1 deletions

@ -221,7 +221,11 @@ class Manager implements IManager {
} }
$task->setStatus(OCPTask::STATUS_SCHEDULED); $task->setStatus(OCPTask::STATUS_SCHEDULED);
$providers = $this->getPreferredProviders($task); $providers = $this->getPreferredProviders($task);
if (count($providers) === 0) { $equivalentTaskProcessingTypeAvailable = (
isset(self::$taskProcessingCompatibleTaskTypes[$task->getType()])
&& isset($this->taskProcessingManager->getAvailableTaskTypes()[self::$taskProcessingCompatibleTaskTypes[$task->getType()]])
);
if (count($providers) === 0 && !$equivalentTaskProcessingTypeAvailable) {
throw new PreConditionNotMetException('No LanguageModel provider is installed that can handle this task'); throw new PreConditionNotMetException('No LanguageModel provider is installed that can handle this task');
} }
[$provider,] = $providers; [$provider,] = $providers;