Skip to content

Commit

Permalink
Merge pull request #221 from jshmrtn/normalizer_timezone_fix
Browse files Browse the repository at this point in the history
Solution: Normalize Timezone from Config
  • Loading branch information
c-rack authored Jul 12, 2017
2 parents 0f324f4 + d2a9f0c commit e7e8b67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/quantum/normalizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ defmodule Quantum.Normalizer do
task: extract(:task, opts),
args: extract(:args, opts, []),
overlap: extract(:overlap, opts, overlap),
nodes: :nodes |> extract(opts, default_nodes()) |> atomize
nodes: :nodes |> extract(opts, default_nodes()) |> atomize,
timezone: extract(:timezone, opts, :utc),
}
end

Expand Down
6 changes: 4 additions & 2 deletions test/normalizer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ defmodule Quantum.NormalizerTest do
task: "MyModule.my_method",
args: [1, 2, 3],
overlap: false,
nodes: [:atom@node, "string@node"]
nodes: [:atom@node, "string@node"],
timezone: "America/Mexico_City"
]}

assert normalize(job) == {:newsletter, %Quantum.Job{
Expand All @@ -27,7 +28,8 @@ defmodule Quantum.NormalizerTest do
task: {"MyModule", "my_method"},
args: [1, 2, 3],
overlap: false,
nodes: [:atom@node, :string@node]
nodes: [:atom@node, :string@node],
timezone: "America/Mexico_City"
}}
end

Expand Down

0 comments on commit e7e8b67

Please sign in to comment.