towerops/lib/towerops/workers/expired_ban_cleanup_worker.ex
2026-06-14 16:38:03 -05:00

18 lines
438 B
Elixir

defmodule Towerops.Workers.ExpiredBanCleanupWorker do
@moduledoc """
Hourly Oban cron worker that deletes expired temporary IP bans.
Cleans up ban records where `banned_until` has passed.
Permanent bans (nil `banned_until`) are not affected.
"""
use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Security.BruteForce
@impl Oban.Worker
def perform(_job) do
BruteForce.delete_expired_bans()
:ok
end
end