Skip to content

Commit

Permalink
Merge pull request #49260 from nextcloud/fix/noid/textprocessing-sche…
Browse files Browse the repository at this point in the history
…dule-taskprocessing-provider

[textprocessing] Fix: Accept scheduling a task if there are equivalent taskprocessing providers only
  • Loading branch information
julien-nc authored Nov 14, 2024
2 parents 0718984 + a52a63f commit 428e7a3
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 428e7a3

Please sign in to comment.