mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
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:
commit
031df2eb2a
1 changed files with 5 additions and 1 deletions
|
|
@ -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…
Reference in a new issue