Skip to content

Commit d7b27c3

Browse files
committed
bug #391 [Store][Cache] Fix setup method (Guikingone)
This PR was merged into the main branch. Discussion ---------- [Store][Cache] Fix `setup` method | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Docs? | no | Issues | None | License | MIT Hi 👋🏻 Here's the `CacheStore` fix as discussed in #335. Commits ------- 394e3f6 ref(store): CacheStore
2 parents 7e4a6f8 + 394e3f6 commit d7b27c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/store/src/Bridge/Local/CacheStore.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ public function setup(array $options = []): void
4343
throw new InvalidArgumentException('No supported options.');
4444
}
4545

46-
$this->cache->clear();
46+
if ($this->cache->hasItem($this->cacheKey)) {
47+
return;
48+
}
49+
50+
$this->cache->get($this->cacheKey, static fn (): array => []);
4751
}
4852

4953
public function add(VectorDocument ...$documents): void

0 commit comments

Comments
 (0)