Skip to content

Commit

Permalink
fix: Revert skipped cache
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Aug 26, 2024
1 parent fed8437 commit e744363
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/Service/TemplateFieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
use OCP\Files\Template\Field;
use OCP\Files\Template\FieldType;
use OCP\Http\Client\IClientService;
use OCP\ICache;
use OCP\ICacheFactory;
use Psr\Log\LoggerInterface;

class TemplateFieldService {
private ICache $cache;

public function __construct(
private IClientService $clientService,
private CapabilitiesService $capabilitiesService,
Expand Down Expand Up @@ -59,7 +56,7 @@ public function extractFields(Node|int $file): array {
$cachedResponse = $localCache->get($cacheName);

if ($cachedResponse !== null) {
// return $cachedResponse;
return $cachedResponse;
}

if ($file->getMimeType() === 'application/pdf') {
Expand Down Expand Up @@ -131,13 +128,13 @@ public function fillFields(Node|int $file, array $fields = [], ?string $destinat

if (is_int($file)) {
$file = $this->rootFolder->getFirstNodeById($file);
}

if (!$file || !$file instanceof File) {
$e = new NotFoundException();
$this->logger->error($e->getMessage());
if (!$file || !$file instanceof File) {
$e = new NotFoundException();
$this->logger->error($e->getMessage());

throw $e;
}
throw $e;
}

if ($file->getMimeType() === 'application/pdf') {
Expand Down

0 comments on commit e744363

Please sign in to comment.