class Prune

Prune orphaned fields from any tag hashes.

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

  1. Removes expired tags from the registry (ZREMRANGEBYSCORE)
  2. Gets active tags from the registry (ZRANGE)
  3. Scans each tag hash for orphaned fields (HSCAN + EXISTS checks)
  4. Removes orphaned fields where the cache key no longer exists (HDEL)
  5. Deletes empty hashes (HLEN == 0)

This cleanup is needed because in lazy flush mode, when cache keys are deleted directly (not via tag flush), the hash field references remain.

Constants

private DEFAULT_SCAN_COUNT

Default number of hash fields to process per HSCAN 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 37
__construct(StoreContext $context)

Create a new prune operation instance.

Parameters

StoreContext $context

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

Execute the prune operation.

Parameters

int $scanCount

Number of fields per HSCAN iteration

Return Value

array