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.Worker, queue: :maintenance

  alias Towerops.Security.BruteForce

  @impl Oban.Worker
  def perform(_job) do
    BruteForce.delete_expired_bans()
    :ok
  end
end
