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 11 months ago
parent 22e2419b28
commit a52a63fc74
No known key found for this signature in database
GPG Key ID: 4141FEE162030638
  1. 6
      lib/private/TextProcessing/Manager.php

@ -221,7 +221,11 @@ class Manager implements IManager {
}
$task->setStatus(OCPTask::STATUS_SCHEDULED);
$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');
}
[$provider,] = $providers;

Loading…
Cancel
Save