Skip to content

Guard queue-depth probe against missing AS custom table #14

@mrtwebdesign

Description

@mrtwebdesign

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

Problem

probe_due_queue_depth() (line 621-622) queries wp_actionscheduler_actions without checking if the table exists. On sites using the older posts-based AS data store, or where AS isn't active, this errors on every throttle-enabled request.

It fails safe — run_mysqli_query() returns null and the probe is treated as unavailable — but the error string gets logged into errors.queue_depth on every AS run, making test_observe logs noisy and harder to read.

Fix options

  1. Cached SHOW TABLES LIKE guard — check once per request, memoize the result
  2. Suppress known "table doesn't exist" errors — detect MySQL error 1146 and return null cleanly without populating the error field
  3. Both — guard + clean error handling

Option 1 is simplest and avoids the query entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeffort: 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