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

Experience with sidekiq-repeat #10

Open
maltoe opened this issue Nov 16, 2018 · 5 comments
Open

Experience with sidekiq-repeat #10

maltoe opened this issue Nov 16, 2018 · 5 comments

Comments

@maltoe
Copy link
Contributor

maltoe commented Nov 16, 2018

Hi guys,

As my last message for today, I'd like to ask whether you had any sort of bad experience with this gem in the last couple years? I've used it in other projects as well and never had any reason to look at anything else, just wondered whether at FlavourSys something came up.

Thanks a lot! Have a wonderful weekend, and hope to see you soon for 🍺

all the best

@dsander
Copy link
Member

dsander commented Nov 19, 2018

I don't think we had any problems or found any bugs in the gem itself. The biggest flaw I see at the moment is the documentation, because of the class level repeat method the user need to make sure to require all sidekiq jobs in development to make sure they are scheduled.

@maltoe
Copy link
Contributor Author

maltoe commented Nov 19, 2018

Not sure if I follow: If you want the jobs to be scheduled in development, you need to manually require them? I thought the sidekiq server process would use Rails eager loading?

@dsander
Copy link
Member

dsander commented Nov 19, 2018

As far as I know Sidekiq switched to the Rails auto- and reloader with version 4. We have this hack in the environment.rb to ensure all jobs are loaded when the Sidekiq server boots.

if Sidekiq.server? && Rails.env == 'development'
  # Trigger auto loading of all workers to ensure repeating jobs are registered
  Dir[Rails.root.join('app/workers/*.rb')].each { |f| File.basename(f, '.rb').camelcase.constantize }
end

@maltoe
Copy link
Contributor Author

maltoe commented Nov 20, 2018

Uh how annoying... Maybe put this in the README?

@dsander
Copy link
Member

dsander commented Nov 20, 2018

Good idea. Maybe we could put that logic into a Railtie or in a Sidekiq.configure_server block in the gems code. We have been using our method for so long that I never really looked at alternatives.

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

No branches or pull requests

2 participants