Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class Manager implements IManager {
private IAppData $appData;
private ?array $preferences = null;
private ?array $providersById = null;
private ICache $cache;
private ICache $distributedCache;

public function __construct(
Expand All @@ -101,7 +100,6 @@ public function __construct(
ICacheFactory $cacheFactory,
) {
$this->appData = $appDataFactory->get('core');
$this->cache = $cacheFactory->createLocal('task_processing::');
$this->distributedCache = $cacheFactory->createDistributed('task_processing::');
}

Expand Down Expand Up @@ -741,8 +739,10 @@ public function getPreferredProvider(string $taskTypeId) {

public function getAvailableTaskTypes(): array {
if ($this->availableTaskTypes === null) {
// We use local cache only because distributed cache uses JSOn stringify which would botch our ShapeDescriptor objects
$this->availableTaskTypes = $this->cache->get('available_task_types');
$cachedValue = $this->distributedCache->get('available_task_types_v2');
if ($cachedValue !== null) {
$this->availableTaskTypes = unserialize($cachedValue);
}
}
if ($this->availableTaskTypes === null) {
$taskTypes = $this->_getTaskTypes();
Expand Down Expand Up @@ -775,7 +775,7 @@ public function getAvailableTaskTypes(): array {
}

$this->availableTaskTypes = $availableTaskTypes;
$this->cache->set('available_task_types', $this->availableTaskTypes, 60);
$this->distributedCache->set('available_task_types_v2', serialize($this->availableTaskTypes), 60);
}

return $this->availableTaskTypes;
Expand Down
Loading