Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop microseconds in job argument assertions #35713

Merged

Conversation

@gmcgibbon
Copy link
Member

@gmcgibbon gmcgibbon commented Mar 22, 2019

Summary

When serializing arguments for Active Jobs, Time, DateTime, and ActiveSupport::TimeInZone all lose a certain degree of precision eg. now = Time.now; Time.iso8601(now.iso8601) == now. We can fix this by adding precision (now = Time.now; Time.iso8601(now.iso8601(20)) == now), but that adds unnecessary size to job payloads. Instead, I've opted to modify the test helper to drop microseconds (and nanoseconds) from passed in time job arguments.

@rails-bot rails-bot bot added the activejob label Mar 22, 2019
Copy link
Member

@rafaelfranca rafaelfranca left a comment

:shipit:

@gmcgibbon gmcgibbon force-pushed the drop_nsec_in_job_argument_assertions branch from 1ab3e27 to 7f03862 Mar 22, 2019
@gmcgibbon gmcgibbon merged commit 5672396 into rails:master Mar 22, 2019
3 checks passed
@gmcgibbon gmcgibbon deleted the drop_nsec_in_job_argument_assertions branch Mar 22, 2019
@kaspth
Copy link
Member

@kaspth kaspth commented Mar 24, 2019

Should we mention this in the guides too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants