Skip to content

Commit

Permalink
fix(textprocessing): accept scheduling a task if there are equivalent…
Browse files Browse the repository at this point in the history
… taskprocessing providers only

Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc authored and backportbot[bot] committed Nov 14, 2024
1 parent e75ed32 commit 8f02796
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/private/TextProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ public function scheduleTask(OCPTask $task): void {
}
$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;
Expand Down

0 comments on commit 8f02796

Please sign in to comment.