-
-
Notifications
You must be signed in to change notification settings - Fork 81
Add option to use time crate instead of chrono
#185
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
Add option to use time crate instead of chrono
#185
Conversation
This is useful for users who are already working with `sqlx` and `time`, bc `sqlx` doesn't allow you to use `chrono` and `time` together. * leaves the default as `chrono` but allows users to opt-in to using `time` instead * adds a `time` feature to `apalis-core`, `apalis-sql` and `apalis-redis` * enabling both `cron` and `time` features now triggers a compile error because `apalis-cron` uses `cron` and `cron` depends on `chrono` * adds `time` to the CI matrix * (subjective) use `datetime - duration` instead of `datetime.sub(duration)`
|
Hi! Thanks for your attention to this PR! I've updated tests, can you restart CI at some point? :) |
|
Fixed rustfmt errors (🤦) |
|
@geofmureithi all checks are passing now, what would you say about merging this PR? Just to clarify – I'm absolutely OK to make any adjustments you'd like, regarding API/docs/examples/... :) |
The main reason this is pending is that I have been trying to move away from feature flags towards using traits. Would you be ok if this PR is worked on into v0.5? We can start making those changes and start a 0.5-alpha branch. |
Sure, no problem!
Makes a lot of sense to me! However, there is one catch, as I see it now: |
I am actually thinking of dropping |
|
@geofmureithi thank you so much for your collaboration! :) |
This is useful for users who are already working with
sqlxandtime, bcsqlxdoesn't allow you to usechronoandtimetogether (I have such a case, for example :)).This PR proposes non-breaking change to allow such users specify that they need
time, notchronochronobut allows users to opt-in to usingtimeinsteadtimefeature toapalis-core,apalis-sqlandapalis-rediscronandtimefeatures now triggers a compile error becauseapalis-cronusescronandcrondepends onchronotimeto the CI matrixdatetime - durationinstead ofdatetime.sub(duration)I'd gladly accept any input from your side on how to make my proposal work for you to include it to the upstream :)