Skip to content

Commit

Permalink
Format using Elixir 1.15 with updated format rules
Browse files Browse the repository at this point in the history
  • Loading branch information
sorentwo committed Jun 22, 2023
1 parent 0b8fd4e commit 92940b1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/oban.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule Oban do
@type option ::
{:dispatch_cooldown, pos_integer()}
| {:engine, module()}
| {:get_dynamic_repo, nil | (() -> pid() | atom())}
| {:get_dynamic_repo, nil | (-> pid() | atom())}
| {:log, false | Logger.level()}
| {:name, name()}
| {:node, String.t()}
Expand Down
2 changes: 1 addition & 1 deletion lib/oban/backoff.ex
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ defmodule Oban.Backoff do
iex> Oban.Backoff.with_retry(fn -> :ok end, 10)
:ok
"""
@spec with_retry((() -> term()), :infinity | pos_integer()) :: term()
@spec with_retry((-> term()), :infinity | pos_integer()) :: term()
def with_retry(fun, retries \\ :infinity) when is_function(fun, 0) do
with_retry(fun, retries, 1)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/oban/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Oban.Config do
@type t :: %__MODULE__{
dispatch_cooldown: pos_integer(),
engine: module(),
get_dynamic_repo: nil | (() -> pid() | atom()),
get_dynamic_repo: nil | (-> pid() | atom()),
log: false | Logger.level(),
name: Oban.name(),
node: String.t(),
Expand Down
4 changes: 3 additions & 1 deletion lib/oban/plugins/lifeline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ defmodule Oban.Plugins.Lifeline do
|> where([j], j.attempt >= j.max_attempts)
|> select([j], map(j, [:id, :queue, :state]))

Repo.update_all(state.conf, query, set: [state: "discarded", discarded_at: DateTime.utc_now()])
Repo.update_all(state.conf, query,
set: [state: "discarded", discarded_at: DateTime.utc_now()]
)
end
end
2 changes: 1 addition & 1 deletion lib/oban/testing.ex
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ defmodule Oban.Testing do
end)
"""
@doc since: "2.12.0"
@spec with_testing_mode(:inline | :manual, (() -> any())) :: any()
@spec with_testing_mode(:inline | :manual, (-> any())) :: any()
def with_testing_mode(mode, fun) when mode in [:manual, :inline] and is_function(fun, 0) do
Process.put(:oban_testing, mode)

Expand Down
2 changes: 1 addition & 1 deletion test/oban/config_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defmodule Oban.ConfigTest do

test ":node is validated as a binary" do
refute_valid(node: nil)
refute_valid(node: '')
refute_valid(node: ~c"")
refute_valid(node: "")
refute_valid(node: " ")
refute_valid(node: MyNode)
Expand Down

0 comments on commit 92940b1

Please sign in to comment.