Skip to content

Commit 428e7a3

Browse files
authored
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
2 parents 0718984 + a52a63f commit 428e7a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/private/TextProcessing/Manager.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,11 @@ public function scheduleTask(OCPTask $task): void {
221221
}
222222
$task->setStatus(OCPTask::STATUS_SCHEDULED);
223223
$providers = $this->getPreferredProviders($task);
224-
if (count($providers) === 0) {
224+
$equivalentTaskProcessingTypeAvailable = (
225+
isset(self::$taskProcessingCompatibleTaskTypes[$task->getType()])
226+
&& isset($this->taskProcessingManager->getAvailableTaskTypes()[self::$taskProcessingCompatibleTaskTypes[$task->getType()]])
227+
);
228+
if (count($providers) === 0 && !$equivalentTaskProcessingTypeAvailable) {
225229
throw new PreConditionNotMetException('No LanguageModel provider is installed that can handle this task');
226230
}
227231
[$provider,] = $providers;

0 commit comments

Comments
 (0)