class Prune

Prune stale and orphaned entries from all tag sorted sets.

This operation performs a complete cleanup of all-mode tag data:

  1. Discovers all tag sorted sets via SCAN (pattern from StoreContext::tagScanPattern())
  2. Removes stale entries via ZREMRANGEBYSCORE (scores between 0 and now)
  3. Removes orphaned entries where the cache key no longer exists (ZSCAN + EXISTS + ZREM)
  4. 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

__construct(StoreContext $context)

Create a new prune operation instance.

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.

Parameters

StoreContext $context

at line 49
array execute(int $scanCount = self::DEFAULT_SCAN_COUNT)

Execute the prune operation.

Parameters

int $scanCount

Number of keys per SCAN/ZSCAN iteration

Return Value

array