defmodule Tarakan.Market.SweepWorker do
  @moduledoc """
  Hourly bounty maintenance: settles bounties whose backing Work task was
  accepted, cancels unfunded fiat bounties past the Checkout window, and
  expires unfilled open bounties with a refund.
  """

  use Oban.Worker, queue: :market, max_attempts: 3

  @impl true
  def perform(_job) do
    Tarakan.Market.settle_accepted()
    Tarakan.Market.expire_stale()
    :ok
  end
end
