Durable.Queue.StaleJobRecovery (Durable v0.1.0-rc)

View Source

Periodically recovers jobs with stale locks.

Jobs can become "stuck" if a worker process crashes without releasing the lock. This GenServer periodically checks for such jobs and releases them back to pending status so they can be picked up again.

Summary

Functions

Returns a specification to start this module under a supervisor.

Manually triggers stale lock recovery.

Starts the stale job recovery process.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

recover_now(durable_name \\ Durable)

@spec recover_now(atom()) :: {:ok, non_neg_integer()} | {:error, term()}

Manually triggers stale lock recovery.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the stale job recovery process.

Options

  • :config - The Durable configuration (required)
  • :interval - Milliseconds between recovery checks (default: 60000)