Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Note: you may refer to `README.md` for description of features.

## Dev (WIP)
- Fixed database cache evictor stopping midway while iterating through the cache table
- This problem was seen on PostgreSQL (see #11), but perhaps some other database engines are also affected

## 2.0.5
- Improved database cache evictor handling of cache prefix
Expand Down
2 changes: 2 additions & 0 deletions src/Database/DatabaseEvictStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ protected function yieldCacheTableItems(): \Generator
->select(['key', 'expiration', DB::raw('LENGTH(key) AS key_bytes'), DB::raw('LENGTH(value) AS value_bytes')])
->where('key', '>', $currentActualKey)
->where(DB::raw("SUBSTRING(key, 1, $prefixLength)"), '=', $cachePrefix)
// PostgreSQL: if no sorting specified, then will ignore primary key index/ordering, which breaks the intended workflow
->orderBy('key')
->limit(1)
->first();
if (!$record) {
Expand Down