Prune
class Prune
Prune stale and orphaned entries from all tag sorted sets.
This operation performs a complete cleanup of all-mode tag data:
- Discovers all tag sorted sets via SCAN (pattern from StoreContext::tagScanPattern())
- Removes stale entries via ZREMRANGEBYSCORE (scores between 0 and now)
- Removes orphaned entries where the cache key no longer exists (ZSCAN + EXISTS + ZREM)
- Deletes empty sorted sets (ZCARD == 0)
Forever items (score = -1) are preserved since ZREMRANGEBYSCORE uses 0 as the lower bound, excluding negative scores.
Constants
| private DEFAULT_SCAN_COUNT |
Default number of keys to process per SCAN iteration. |
Methods
array
execute(int $scanCount = self::DEFAULT_SCAN_COUNT)
Execute the prune operation.
Details
at line 38
__construct(StoreContext $context)
Create a new prune operation instance.
at line 49
array
execute(int $scanCount = self::DEFAULT_SCAN_COUNT)
Execute the prune operation.