Skip to content

Remove dead cache_ttl_seconds from THROTTLE_THRESHOLDS #15

@mrtwebdesign

Description

@mrtwebdesign

Source: PR #4 follow-up review (should address)

Problem

cache_ttl_seconds is defined in THROTTLE_THRESHOLDS (line 74) but never read anywhere in the code. The actual TTL calculation in persist_throttle_state() (line 527) uses max(60, level_min_dwell_seconds * 4).

Since THROTTLE_THRESHOLDS is exposed to operators via the hypercart_query_guard_load_thresholds filter, having a dead key is confusing — someone will try to tune it and wonder why nothing changes.

Fix

Either:

  1. Remove it from the constant and document the actual TTL formula
  2. Wire it up — replace the hardcoded formula in persist_throttle_state() with $thresholds['cache_ttl_seconds']

Option 1 is simpler unless there's a reason operators should control the cache TTL independently of dwell time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupHousekeeping, dead code, stale fileseffort: lowMinutes to ~1 hourpriority: mediumShould address in near-term

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions