diff --git a/CHANGELOG.md b/CHANGELOG.md index 40099f6..e8dc2d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.7.0] - 2020-01-22 + +### Added + +- Added logger sanitization funcionality + ## [0.6.1] - 2019-12-30 ### Fixed @@ -47,7 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial version -[Unreleased]: https://github.com/rai200890/ecto-job-scheduler/compare/v0.6.1...HEAD +[Unreleased]: https://github.com/rai200890/ecto-job-scheduler/compare/v0.7.0...HEAD +[0.7.0]: https://github.com/rai200890/ecto-job-scheduler/compare/v0.6.1...v0.7.0 [0.6.1]: https://github.com/rai200890/ecto-job-scheduler/compare/v0.6.0...v0.6.1 [0.6.0]: https://github.com/rai200890/ecto-job-scheduler/compare/v0.5.0...v0.6.0 [0.5.0]: https://github.com/rai200890/ecto-job-scheduler/compare/v0.4.0...v0.5.0 diff --git a/VERSION b/VERSION index 7ceb040..bcaffe1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.1 \ No newline at end of file +0.7.0 \ No newline at end of file diff --git a/config/test.exs b/config/test.exs index 12633bf..a83e335 100644 --- a/config/test.exs +++ b/config/test.exs @@ -15,7 +15,7 @@ config :ecto_job_scheduler, EctoJobScheduler.Test.TestJobNotMultiError, max_atte sanitize_fun = fn params -> params |> Map.delete("cpf") - |> Map.drop(["gokou", "xablau"]) + |> Map.drop(["little master", "xablau"]) end config :ecto_job_scheduler, sanitizer: sanitize_fun diff --git a/lib/job.ex b/lib/job.ex index f06a527..900def3 100644 --- a/lib/job.ex +++ b/lib/job.ex @@ -25,16 +25,14 @@ defmodule EctoJobScheduler.Job do {context, params} = Map.pop(params, "context", %{}) job_context = %{ - "params" => params, + "params" => params |> sanitizer().(), "attempt" => attempt, "max_attempts" => max_attempts } Context.put(context) - job_context - |> sanitizer().() - |> Context.put() + Context.put(job_context) Logger.info("Attempting to run #{inspect(__MODULE__)} #{attempt} out of #{max_attempts}") diff --git a/test/job_queue_test.exs b/test/job_queue_test.exs index 789fe2b..964c31a 100644 --- a/test/job_queue_test.exs +++ b/test/job_queue_test.exs @@ -13,6 +13,9 @@ defmodule EctoJobScheduler.JobQueueTest do test "when job returns multi and return is successful, should delete job" do job_args = %{ "type" => "TestJob", + "little master" => "Rai99", + "cpf" => "12345678910", + "xablau" => "jo", "context" => %{some: :thing} }