-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e77b84f
commit 5f4c3d8
Showing
40 changed files
with
3,030 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
RAILS_ENV = ENV['RAILS_ENV'] || 'staging' | ||
WORKING_DIR = ENV['RAILS_ROOT'] || '/home/rails/apps/supportbee_app_platform/current' | ||
PID_DIR = "#{WORKING_DIR}/tmp/pids" | ||
|
||
Eye.config do | ||
logger File.join WORKING_DIR, 'log', 'eye.log' | ||
end | ||
|
||
Eye.application 'AppPlatform' do | ||
working_dir WORKING_DIR | ||
|
||
process 'sidekiq' do | ||
start_command "rvm-exec ruby-2.2.3 bundle exec sidekiq -C #{WORKING_DIR}/config/sidekiq/staging.yml -r #{WORKING_DIR}/config/load.rb" | ||
stop_signals [:USR1, 25.seconds, :TERM, 15.seconds] # See https://github.com/mperham/sidekiq/wiki/Signals | ||
|
||
env 'RAILS_ENV' => RAILS_ENV | ||
daemonize true | ||
pid_file "#{PID_DIR}/sidekiq.pid" | ||
|
||
stdall "#{WORKING_DIR}/log/sidekiq.log" | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
:queues: | ||
- app_events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Sidekiq Pro | ||
|
||
This gem adds advanced functionality and a commercial license for the Sidekiq | ||
background job framework. | ||
|
||
## What's Provided | ||
|
||
* **Batch** - adds the notion of a set of jobs, so you can track progress | ||
of the batch and receive notification when the batch is complete. The | ||
Sidekiq Web UI provides a convenient overview of all Batches being processed | ||
and their status. | ||
|
||
* **Reliability** - adds reliability upgrades to the client push to Redis | ||
and the server fetch from Redis, to better withstand network outages | ||
and process crashes. | ||
|
||
* **Much, much more** - Statsd, pause queues, API extensions, expire | ||
jobs, etc. | ||
|
||
|
||
## Download | ||
|
||
When you purchase Sidekiq Pro, you will receive an email within 24 hours | ||
with your own personalized download URL. This URL can be used with a | ||
Gemfile: | ||
|
||
source 'https://rubygems.org' | ||
source 'https://YOUR:[email protected]/' | ||
|
||
gem 'sidekiq-pro' | ||
|
||
Please keep this URL private; I do reserve the right to revoke access if | ||
the URL is made public and/or is being used to illegally download Sidekiq Pro. | ||
|
||
|
||
## Usage | ||
|
||
Please see the Sidekiq wiki for in-depth documentation on each Sidekiq | ||
Pro feature and how to use it. | ||
|
||
|
||
## Licensing | ||
|
||
This library is sold commercially to provide support for the development of Sidekiq. | ||
**The gem file or any of its contents may not be publicly distributed.** | ||
|
||
See COMM-LICENSE for the license terms. | ||
|
||
|
||
## Support | ||
|
||
Please open an issue in the Sidekiq issue tracker or send an email to | ||
the sidekiq mailing list. If you note that you are a Pro user, I will | ||
make an effort to reply within 24 hours. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
require 'sidekiq' | ||
require 'sidekiq/pro/version' | ||
require 'sidekiq/pro/worker' | ||
require 'sidekiq/pro/api' | ||
require 'sidekiq/pro/push' | ||
require 'sidekiq/pro/util' | ||
require 'sidekiq/batch' | ||
|
||
Sidekiq.send(:remove_const, :LICENSE) | ||
Sidekiq.send(:remove_const, :NAME) | ||
Sidekiq::NAME = "Sidekiq Pro" | ||
Sidekiq::LICENSE = "Sidekiq Pro #{Sidekiq::Pro::VERSION}, commercially licensed. Thanks for your support!" | ||
|
||
Sidekiq.configure_server do | ||
class Sidekiq::CLI | ||
def self.banner | ||
File.read(File.expand_path(File.join(__FILE__, '../sidekiq/intro.ans'))) | ||
end | ||
end | ||
require 'sidekiq/pro/basic_fetch' | ||
Sidekiq.options[:fetch] = Sidekiq::Pro::BasicFetch | ||
end | ||
|
||
|
||
# Enable various reliability add-ons: | ||
# | ||
# Sidekiq.configure_server do |config| | ||
# config.reliable_fetch! | ||
# config.reliable_scheduler! | ||
# config.timed_fetch! | ||
# # enable both | ||
# config.reliable! | ||
# end | ||
# | ||
module Sidekiq | ||
def self.reliable_fetch! | ||
require 'sidekiq/pro/fetch' | ||
Sidekiq.options[:fetch] = Sidekiq::Pro::ReliableFetch | ||
Sidekiq.options[:ephemeral_hostname] ||= !!ENV['DYNO'] | ||
env = Sidekiq.options[:environment] | ||
Sidekiq.options[:index] ||= 0 if !env || env == 'development' | ||
Array(Sidekiq.options[:labels]) << 'reliable' | ||
nil | ||
end | ||
|
||
def self.super_fetch! | ||
require 'sidekiq/pro/super_fetch' | ||
Sidekiq.options[:fetch] = Sidekiq::Pro::SuperFetch | ||
Array(Sidekiq.options[:labels]) << 'reliable' | ||
nil | ||
end | ||
|
||
def self.timed_fetch!(timeout = 3600) | ||
require 'sidekiq/pro/timed_fetch' | ||
Sidekiq.options[:fetch] = Sidekiq::Pro::TimedFetch | ||
Array(Sidekiq.options[:labels]) << 'reliable' | ||
|
||
Sidekiq.configure_server do |config| | ||
config.on(:startup) do | ||
klass = Sidekiq::Pro::TimedFetch::Manager | ||
klass.instance = klass.new(Sidekiq.options) | ||
klass.instance.timeout = timeout | ||
end | ||
end | ||
nil | ||
end | ||
|
||
def self.reliable_scheduler! | ||
require 'sidekiq/pro/scheduler' | ||
Sidekiq.options[:scheduled_enq] = Sidekiq::Scheduled::FastEnq | ||
end | ||
|
||
def self.reliable! | ||
reliable_fetch! | ||
reliable_scheduler! | ||
end | ||
|
||
def self.redis_pool | ||
# Slight tweak to allow sharding support | ||
Thread.current[:sidekiq_redis_pool] || (@redis ||= Sidekiq::RedisConnection.create) | ||
end | ||
end |
Oops, something went wrong.