Comments (10)
The schedule should we reloaded fresh everytime you start your app, ill try to reproduce this and comment back.
What version of sidekiq-scheduler are you using?
from sidekiq-scheduler.
@adrian-gomez awesome, thanks. would appreciate any pointers.
I'm using the latest - v1.0.
from sidekiq-scheduler.
I'm seeing the same issue but only with the rails console, if i start the server or sidekiq the schedules are loaded properly. Can you confirm this?
I'll look into this issue to find out what is causing this behavior.
from sidekiq-scheduler.
@adrian-gomez I was able to confirm that I just print out Sidekiq.scheduler
into a view and then fire up bundle exec rails s
, then change the schedule, restart bundle exec rails s
, the output of the view does change. So yes, it does appear to be the console.
from sidekiq-scheduler.
There also seems like modifying the initializer (config/initializers/sidekiq_scheduler.rb) causes the schedule to reload :S
This is really strange.
from sidekiq-scheduler.
@adrian-gomez I think it's the Rails spring preloader.
vagrant@precise64:/vagrant$ spring status
Spring is not running.
vagrant@precise64:/vagrant$ rails c
Loading development environment (Rails 4.1.4)
[1] pry(main)> puts Sidekiq.schedule
{"queue_delayed_order_notifications"=>{"every"=>["1m"], "class"=>"DelayedOrderNotifications", "description"=>"This job looks for delayed orders and triggers the appropriate notifications"}}
=> nil
[2] pry(main)> exit
vagrant@precise64:/vagrant$ spring status
Spring is running:
4759 spring server | vagrant | started 25 secs ago
4763 spring app | vagrant | started 25 secs ago | development mode
vagrant@precise64:/vagrant$ spring stop
Spring stopped.
[ Change the schedule from 1m to 1h ]
vagrant@precise64:/vagrant$ rails c
Loading development environment (Rails 4.1.4)
[1] pry(main)> puts Sidekiq.schedule
{"queue_delayed_order_notifications"=>{"every"=>["1h"], "class"=>"DelayedOrderNotifications", "description"=>"This job looks for delayed orders and triggers the appropriate notifications"}}
=> nil
By manually stopping Spring, it seems to work.
from sidekiq-scheduler.
Ok i'll close this issue if you are ok with it.
I haven't looked into spring at all, maybe there is a workaround for this that i'm not aware of.
from sidekiq-scheduler.
Sure, I'm fine with closing this now that I understand what's going on.
Apparently, Spring reloads the initializers if they are changed, but not if they are unmodified, so that's what's happening.
It appears to be possible to tell Spring to do things before loading: https://github.com/rails/spring#running-code-before-forking
So this could potentially be used to clean this up.
It might be worth putting a note in the README about this, in case anyone else encounters this.
from sidekiq-scheduler.
I'll great if you could add that comment to in the README :D
from sidekiq-scheduler.
PR submitted :)
from sidekiq-scheduler.
Related Issues (20)
- Sidekiq 7.0 support? HOT 25
- 4.0.4 tag to support sidekiq 7+ HOT 3
- Documentation shows six * and it should be five HOT 1
- 404 for sidekiq/stylesheets-scheduler/recurring_jobs.css HOT 3
- Sidekiq will periodically report JSON argument errors when using metadata on some machines
- Support for Sidekiq Embed
- I am not able to make SFTP connection through my worker in prod environment HOT 1
- Documentation issue with scheduler nesting HOT 2
- Did sidekiq-scheduler 5.0.0 add a Rails dependency? HOT 3
- Raises an exception when rufus_scheduler_options is nil by default HOT 3
- Could not find gem 'sidekiq-scheduler (= 5.0.1)' with platform 'arm64-darwin-21' HOT 1
- Sidekiq version requirement HOT 1
- Run job multiple times, but never at the same time HOT 3
- Uppercase character in header name: Cache-Control
- Sidekiq 7.1 warns when deprecated Redis commands are used
- Cron expression with day of month does not work HOT 4
- Support for Ruby 3.0 and deconstruct Hashes as keyword arguments. HOT 5
- Move away from deprecated Redis commands HOT 2
- undefined method `next_time' for nil:NilClass HOT 5
- re-use Sidekiq Rack::Static instance for assets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidekiq-scheduler.