mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
fix(textprocessing): accept scheduling a task if there are equivalent taskprocessing providers only
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
22e2419b28
commit
a52a63fc74
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