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

Support crons with timezone for sidekiq-scheduler #2209

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

sl0thentr0py
Copy link
Member

closes #2187

Copy link

codecov bot commented Dec 27, 2023

Codecov Report

Merging #2209 (3c134d0) into master (d02cf27) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2209   +/-   ##
=======================================
  Coverage   97.39%   97.39%           
=======================================
  Files         101      101           
  Lines        3799     3805    +6     
=======================================
+ Hits         3700     3706    +6     
  Misses         99       99           
Components Coverage Δ
sentry-ruby 98.07% <ø> (ø)
sentry-rails 94.98% <ø> (ø)
sentry-sidekiq 94.70% <100.00%> (+0.17%) ⬆️
sentry-resque 93.65% <ø> (ø)
sentry-delayed_job 94.44% <ø> (ø)
sentry-opentelemetry 100.00% <ø> (ø)
Files Coverage Δ
...-sidekiq/lib/sentry/sidekiq-scheduler/scheduler.rb 93.10% <100.00%> (+1.79%) ⬆️

Copy link
Contributor

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Stefan Jandl <[email protected]>
@sl0thentr0py sl0thentr0py merged commit 2f9ffaf into master Dec 27, 2023
1 of 43 checks passed
@sl0thentr0py sl0thentr0py deleted the neel/sidekiq-scheduler-timezone branch December 27, 2023 18:52
Copy link

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Support crons with timezone for sidekiq-scheduler ([#2209](https://github.com/getsentry/sentry-ruby/pull/2209))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 9b24de9

@@ -133,8 +133,10 @@ def perform
end
end

class HappyWorkerForCron < HappyWorker; end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need another HappyWorkerForCron?

Copy link
Member Author

@sl0thentr0py sl0thentr0py Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to keep each class isolated after patching, since we don't have a 'reverse prepend'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I mean we already had this worker before this PR, so now we have 2:

class HappyWorkerForCron < HappyWorker; end
class HappyWorkerForCron < HappyWorker; end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah hmm that was probably copypasta error, thx

@@ -37,7 +37,18 @@ def new_job(name, interval_type, config, schedule, options)
# so we convert it to minutes before passing in to the monitor.
monitor_config = case interval_type
when "cron"
Sentry::Cron::MonitorConfig.from_crontab(schedule)
parsed_cron = ::Fugit.parse_cron(schedule)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we mention the origin of Fugit in a comment? It's a second-level dependency of sidekiq-scheduler, through the rufus-scheduler gem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

Support extracting timezone out of crontab in sidekiq-scheduler
3 participants