Tracks FunConfig entries that failed validation during pull or push.
Stores the original config (as a map), the reason(s) for failure, the source (pull or push), the node that provided the config, and a timestamp. Entries auto-expire after 24 hours (TTL).
ETS table
- Named
:phoenix_gen_api_config_failed {:set, :public, read_concurrency: true, write_concurrency: true}- Key:
{id}whereidis a monotonically increasing integer - Each entry is a map with
:id,:service,:request_type,:version,:source,:node,:reason,:config,:inserted_at_ms,:expires_at_ms
TTL
Entries expire after 24 hours. Call cleanup/0 periodically to purge expired
entries. Query functions (list/1, count/0) automatically filter out expired
entries.
Summary
Functions
Removes all expired entries from the table. Returns the number of entries removed.
Clears all entries regardless of expiry.
Returns the count of non-expired failed entries.
Initializes the ETS table. Called by the application supervisor.
Returns all non-expired failed entries, optionally filtered by source.
Records a failed FunConfig validation.
Starts the ConfigFailed table under the supervisor.
Returns a summary of failed entries grouped by source.
Functions
@spec cleanup() :: non_neg_integer()
Removes all expired entries from the table. Returns the number of entries removed.
@spec clear() :: :ok
Clears all entries regardless of expiry.
@spec count() :: non_neg_integer()
Returns the count of non-expired failed entries.
@spec init() :: :ok
Initializes the ETS table. Called by the application supervisor.
Returns all non-expired failed entries, optionally filtered by source.
Options
:source— filter by:pullor:push:service— filter by service name:limit— max number of entries to return (default: 100):order—:newest_first(default) or:oldest_first
@spec record( map() | PhoenixGenApi.Structs.FunConfig.t(), String.t() | [String.t()], atom(), atom() | nil ) :: map()
Records a failed FunConfig validation.
Parameters
config— the%FunConfig{}struct (or map) that failedreason— a string or list of strings describing why it failedsource—:pullor:pushnode— the node that provided the config (or:local/nil)
Returns
The inserted entry map.
Starts the ConfigFailed table under the supervisor.
@spec summary() :: map()
Returns a summary of failed entries grouped by source.