Skip to content

Commit

Permalink
Merge pull request #417 from Shopify/mangara-serialize-total-time
Browse files Browse the repository at this point in the history
Ensure type-safe deserialization
  • Loading branch information
Mangara authored Aug 16, 2023
2 parents 6feb0d5 + 1734a3e commit 7867dc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions lib/job-iteration/iteration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7867dc4

Please sign in to comment.