diff options
author | Julien Veyssier <julien-nc@posteo.net> | 2024-11-13 16:59:46 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-11-14 10:59:16 +0000 |
commit | 8f02796a62c99031b6c89687841be1212f8eea12 (patch) | |
tree | 3060deb8f817e1f46b3f8f3a681ab177bb137c00 /lib | |
parent | e75ed32cacc9516071a883d6dbcf88c6bd19ee1b (diff) | |
download | nextcloud-server-8f02796a62c99031b6c89687841be1212f8eea12.tar.gz nextcloud-server-8f02796a62c99031b6c89687841be1212f8eea12.zip |
fix(textprocessing): accept scheduling a task if there are equivalent taskprocessing providers onlybackport/49260/stable30
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/TextProcessing/Manager.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index 17778d31091..63157d3164a 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/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; |