diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f6e75f2..a8fc3c09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - [310](https://github.com/Shopify/job-iteration/pull/310) - Support nested iteration - [338](https://github.com/Shopify/job-iteration/pull/338) - All logs are now `ActiveSupport::Notifications` events and logged using `ActiveSupport::LogSubscriber` to allow customization. Events now always include the `cursor_position` tag. - [341](https://github.com/Shopify/job-iteration/pull/341) - Add `JobIteration.default_retry_backoff`, which sets a default delay when jobs are re-enqueued after being interrupted. Defaults to `nil`, meaning no delay, which matches the current behaviour. +- [417](https://github.com/Shopify/job-iteration/pull/417) - Ensure that numerical values are deserialized as such and not as strings. ## v1.3.6 (Mar 9, 2022) diff --git a/lib/job-iteration/iteration.rb b/lib/job-iteration/iteration.rb index acccdc6b..7a6224a2 100644 --- a/lib/job-iteration/iteration.rb +++ b/lib/job-iteration/iteration.rb @@ -119,8 +119,8 @@ def serialize # @private def deserialize(job_data) # @private super self.cursor_position = job_data["cursor_position"] - self.times_interrupted = job_data["times_interrupted"] || 0 - self.total_time = job_data["total_time"] || 0 + self.times_interrupted = Integer(job_data["times_interrupted"] || 0) + self.total_time = Float(job_data["total_time"] || 0.0) end def perform(*params) # @private