Merge pull request #49280 from nextcloud/backport/49260/stable30

[stable30] [textprocessing] Fix: Accept scheduling a task if there are equivalent taskprocessing providers only
This commit is contained in:
Julien Veyssier 2024-11-14 12:52:04 +01:00 committed by GitHub
commit 031df2eb2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;