Steward.Oban (Steward v0.1.0)

Copy Markdown View Source

Helper functions for dealing with Steward managed jobs.

Summary

Functions

Fetches all jobs for a given resource.

Deletes all jobs for a given resource.

Functions

all_resource_jobs(oban \\ Oban, resource_or_resources)

(since 0.1.0)
@spec all_resource_jobs(Oban.name(), Steward.Resource.t() | [Steward.Resource.t()]) ::
  [Oban.Job.t()]

Fetches all jobs for a given resource.

delete_resource_jobs(oban \\ Oban, resource_or_resources)

(since 0.1.0)
@spec delete_resource_jobs(Oban.name(), Steward.Resource.t() | [Steward.Resource.t()]) ::
  {:ok, non_neg_integer()}

Deletes all jobs for a given resource.

If you wish to halt reconciliation for the resource, see Steward.Controller.cancel_resource!/2 instead, and wait for the next reconciliation to delete pending resource jobs automatically.

Steward then deletes the remaining jobs of cancelled resources after some time, see the :prune_max_age option of Steward.Plugin.