ActivityPub.Federator.Workers.PublisherWorker (Bonfire v1.0.1-social-alpha.14)
View SourceSummary
Functions
Returns worker args with Oban's scheduled_at set if the activity's published date is in the future.
Functions
Returns worker args with Oban's scheduled_at set if the activity's published date is in the future.
Examples
iex> now = DateTime.utc_now()
iex> future = DateTime.add(now, 3600, :second) |> DateTime.to_iso8601()
iex> params = %{"object" => %{"published" => future}}
iex> ActivityPub.Federator.Workers.PublisherWorker.maybe_schedule_worker_args(params, []) |> Keyword.has_key?(:scheduled_at)
true
iex> params = %{"published" => DateTime.utc_now() |> DateTime.to_iso8601()}
iex> ActivityPub.Federator.Workers.PublisherWorker.maybe_schedule_worker_args(params, [])
[]