Comments (8)
Just to update, since we're using Heroku, we are taking advantage of the DYNO
environment variable to determine if we are on the correct worker process. Currently we only have one of these dynos, so this works, but it doesn't address how to deal with it in development (where Foreman won't provide the worker names to us).
if Rails.env.development? || ENV['DYNO'] =~ /^sidekiq_util/
require 'sidekiq/scheduler'
Sidekiq.schedule = YAML.load_file(Rails.root.join('config/schedule.yml'))
end
from sidekiq-scheduler.
👍 I'm also running into this issue, @ygoldshtrakh did you figure out how to get around it?
from sidekiq-scheduler.
Were in a time crunch so moved to clockwork instead
On Wed, Oct 8, 2014 at 11:49 AM, Jonathan Geggatt [email protected]
wrote:
[image: 👍] I'm also running into this issue, @ygoldshtrakh
https://github.com/ygoldshtrakh did you figure out how to get around it?—
Reply to this email directly or view it on GitHub
#41 (comment)
.
from sidekiq-scheduler.
@ygoldshtrakh Do you mind posting a Gist of what you did to move to clockwork?
from sidekiq-scheduler.
We got rid of schedule.yml file and rewritten it into clockwork.rb
On Wed, Oct 22, 2014 at 11:41 AM, Peter Sankauskas <[email protected]
wrote:
@ygoldshtrakh https://github.com/ygoldshtrakh Do you mind posting a
Gist of what you did to move to clockwork?—
Reply to this email directly or view it on GitHub
#41 (comment)
.
from sidekiq-scheduler.
OK. I don't see how that solves the problem:
https://github.com/tomykaira/clockwork#in-production
You still need extra work to only run clockwork on a single server.
What I want is to include sidekiq-scheduler on every server. No server should be special. It should use a sidekiq queue as it's data store and avoid duplicating tasks that way.
from sidekiq-scheduler.
+1
Same issue here, using @jgeggatt's fix for now.
from sidekiq-scheduler.
Take a look at https://github.com/itbeaver/sidekiq-scheduler/pull/1/files
# config/initializers/sidekiq_scheduler.rb
require 'sidekiq/scheduler'
puts "Sidekiq.server? is #{Sidekiq.server?.inspect}"
puts "defined?(Rails::Server) is #{defined?(Rails::Server).inspect}"
puts "defined?(Unicorn) is #{defined?(Unicorn).inspect}"
if Rails.env == 'production' && (defined?(Rails::Server) || defined?(Unicorn))
Sidekiq.schedule = YAML
.load_file(File.expand_path('../../../config/scheduler.yml', __FILE__))
Sidekiq::Scheduler.reload_schedule!
else
Sidekiq::Scheduler.enabled = false
puts "Sidekiq::Scheduler.enabled is #{Sidekiq::Scheduler.enabled.inspect}"
end
I use this gem with Unicorn, him process start sidekiq-scheduler and queue tasks
But sidekiq workers disables it when starting by option Sidekiq::Scheduler.enabled
After writing test I make a PR into this repo
from sidekiq-scheduler.
Related Issues (20)
- 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
- RedisManager does not appear to be updating in test env HOT 6
- Sidekick (docker) deprecation warning HOT 1
- UI not loading on heroku HOT 7
- Error handler threw an error HOT 2
- [feature request] environment specific schedules HOT 1
- Recommend Sidekiq::Job instead of Sidekiq::Worker HOT 1
- How to test that sidekiq.yml is *correct*? HOT 3
- SidekiqScheduler::Manager enormous inspect output HOT 2
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.