ExPipedriveOban.Sync (ex_pipedrive_oban v0.1.1)

Copy Markdown View Source

Fetches one cursor page and computes Oban snooze delays.

ExPipedriveOban.SyncWorker wraps this for job unique keys and enqueueing the next page. Tests can call page/2 without running Oban.

Summary

Functions

Loads one v2 cursor page for args["resource"].

Resources that can be synced via list_page/2.

Oban snooze seconds for a rate-limit error (at least 1).

Functions

page(client, args)

@spec page(Tesla.Client.t(), map()) ::
  {:ok, ExPipedrive.Page.t()}
  | {:error, ExPipedrive.Error.t() | :unknown_resource}

Loads one v2 cursor page for args["resource"].

Extra Pipedrive list filters come from args["list_opts"] (string-key map).

resources()

@spec resources() :: [String.t()]

Resources that can be synced via list_page/2.

snooze_seconds(arg1)

@spec snooze_seconds(ExPipedrive.Error.t()) :: pos_integer()

Oban snooze seconds for a rate-limit error (at least 1).