GamendWeb.IpBanSync (gamend_web v1.0.1215)

Copy Markdown View Source

Keeps the node-local IP-ban ETS table in sync with the database and the other app instances.

After init it loads persisted bans (Gamend.IpBans) into ETS; afterwards it applies ban/unban events broadcast by other instances on the GamendWeb.Plugs.IpBan.topic/0 PubSub topic. Events originating on this node are skipped — the plug already applied them locally.

The initial load runs in handle_continue and retries on failure instead of failing the boot: init/1 must not couple application startup to the database being reachable (e.g. during rolling restarts). Every failed attempt logs an error, so an unmigrated ip_bans table stays loudly visible without crash-looping the whole application.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)