mirror of
https://github.com/nextcloud/server.git
synced 2026-04-26 00:27:49 -04:00
fix: always regenerate availabe task types
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
This commit is contained in:
parent
3857decfcb
commit
40fc07b543
1 changed files with 32 additions and 33 deletions
|
|
@ -733,43 +733,42 @@ class Manager implements IManager {
|
|||
}
|
||||
|
||||
public function getAvailableTaskTypes(bool $showDisabled = false): array {
|
||||
if ($this->availableTaskTypes === null) {
|
||||
$taskTypes = $this->_getTaskTypes();
|
||||
$taskTypeSettings = $this->_getTaskTypeSettings();
|
||||
$taskTypes = $this->_getTaskTypes();
|
||||
$taskTypeSettings = $this->_getTaskTypeSettings();
|
||||
|
||||
$availableTaskTypes = [];
|
||||
foreach ($taskTypes as $taskType) {
|
||||
if ((!$showDisabled) && isset($taskTypeSettings[$taskType->getId()]) && !$taskTypeSettings[$taskType->getId()]) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$provider = $this->getPreferredProvider($taskType->getId());
|
||||
} catch (\OCP\TaskProcessing\Exception\Exception $e) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$availableTaskTypes[$provider->getTaskTypeId()] = [
|
||||
'name' => $taskType->getName(),
|
||||
'description' => $taskType->getDescription(),
|
||||
'optionalInputShape' => $provider->getOptionalInputShape(),
|
||||
'inputShapeEnumValues' => $provider->getInputShapeEnumValues(),
|
||||
'inputShapeDefaults' => $provider->getInputShapeDefaults(),
|
||||
'inputShape' => $taskType->getInputShape(),
|
||||
'optionalInputShapeEnumValues' => $provider->getOptionalInputShapeEnumValues(),
|
||||
'optionalInputShapeDefaults' => $provider->getOptionalInputShapeDefaults(),
|
||||
'outputShape' => $taskType->getOutputShape(),
|
||||
'outputShapeEnumValues' => $provider->getOutputShapeEnumValues(),
|
||||
'optionalOutputShape' => $provider->getOptionalOutputShape(),
|
||||
'optionalOutputShapeEnumValues' => $provider->getOptionalOutputShapeEnumValues(),
|
||||
];
|
||||
} catch (\Throwable $e) {
|
||||
$this->logger->error('Failed to set up TaskProcessing provider ' . $provider::class, ['exception' => $e]);
|
||||
}
|
||||
$availableTaskTypes = [];
|
||||
foreach ($taskTypes as $taskType) {
|
||||
if ((!$showDisabled) && isset($taskTypeSettings[$taskType->getId()]) && !$taskTypeSettings[$taskType->getId()]) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$provider = $this->getPreferredProvider($taskType->getId());
|
||||
} catch (\OCP\TaskProcessing\Exception\Exception $e) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$availableTaskTypes[$provider->getTaskTypeId()] = [
|
||||
'name' => $taskType->getName(),
|
||||
'description' => $taskType->getDescription(),
|
||||
'optionalInputShape' => $provider->getOptionalInputShape(),
|
||||
'inputShapeEnumValues' => $provider->getInputShapeEnumValues(),
|
||||
'inputShapeDefaults' => $provider->getInputShapeDefaults(),
|
||||
'inputShape' => $taskType->getInputShape(),
|
||||
'optionalInputShapeEnumValues' => $provider->getOptionalInputShapeEnumValues(),
|
||||
'optionalInputShapeDefaults' => $provider->getOptionalInputShapeDefaults(),
|
||||
'outputShape' => $taskType->getOutputShape(),
|
||||
'outputShapeEnumValues' => $provider->getOutputShapeEnumValues(),
|
||||
'optionalOutputShape' => $provider->getOptionalOutputShape(),
|
||||
'optionalOutputShapeEnumValues' => $provider->getOptionalOutputShapeEnumValues(),
|
||||
];
|
||||
} catch (\Throwable $e) {
|
||||
$this->logger->error('Failed to set up TaskProcessing provider ' . $provider::class, ['exception' => $e]);
|
||||
}
|
||||
|
||||
$this->availableTaskTypes = $availableTaskTypes;
|
||||
}
|
||||
|
||||
$this->availableTaskTypes = $availableTaskTypes;
|
||||
|
||||
|
||||
return $this->availableTaskTypes;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue