mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Merge pull request #49260 from nextcloud/fix/noid/textprocessing-schedule-taskprocessing-provider
[textprocessing] Fix: Accept scheduling a task if there are equivalent taskprocessing providers only
This commit is contained in:
commit
428e7a32b9
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