5 changed files with 47 additions and 30 deletions
@ -1,10 +0,0 @@ |
|||
#!/usr/bin/env ruby |
|||
require 'sidekiq' |
|||
options = { |
|||
url: ENV['REDIS_URL'], |
|||
namespace: :cryptcheck |
|||
} |
|||
client = Sidekiq::Client.new Sidekiq::RedisConnection.create options |
|||
clazz, *args = ARGV |
|||
clazz += 'Worker' |
|||
client.push({ 'class' => clazz, 'args' => args }) |
@ -0,0 +1 @@ |
|||
runner |
@ -0,0 +1,22 @@ |
|||
#!/usr/bin/env ruby |
|||
ENV['RAILS_ENV'] ||= 'development' |
|||
require 'dotenv' |
|||
Dotenv.load ".env.#{ENV['RAILS_ENV']}", '.env' |
|||
|
|||
if ENV['RAILS_ENV'] == 'development' |
|||
DIR = File.dirname File.dirname File.expand_path __FILE__ |
|||
require File.join DIR, 'config/environment' |
|||
ENV['RAILS_ENV'] = 'test' |
|||
require 'sidekiq/testing/inline' |
|||
end |
|||
|
|||
require 'sidekiq' |
|||
options = { |
|||
url: ENV['REDIS_URL'], |
|||
namespace: :cryptcheck |
|||
} |
|||
client = Sidekiq::Client.new Sidekiq::RedisConnection.create options |
|||
|
|||
clazz, *args = ARGV |
|||
clazz += 'Worker' |
|||
client.push({ 'class' => clazz, 'args' => args }) |
@ -0,0 +1,3 @@ |
|||
#!/bin/bash |
|||
DIR="$(readlink -m "$(dirname "$0")")" |
|||
LD_LIBRARY_PATH="${DIR}/../../cryptcheck/lib" "${0}.rb" $* |
@ -1,20 +0,0 @@ |
|||
#!/usr/bin/env ruby |
|||
$:.unshift File.expand_path File.join File.dirname(__FILE__), '../../cryptcheck/lib' |
|||
require 'rubygems' |
|||
require 'bundler/setup' |
|||
|
|||
$TESTING = false |
|||
$CELLULOID_DEBUG = false |
|||
|
|||
require 'sidekiq/cli' |
|||
|
|||
begin |
|||
cli = Sidekiq::CLI.instance |
|||
cli.parse |
|||
cli.run |
|||
rescue => e |
|||
raise e if $DEBUG |
|||
STDERR.puts e.message |
|||
STDERR.puts e.backtrace.join("\n") |
|||
exit 1 |
|||
end |
@ -0,0 +1 @@ |
|||
runner |
@ -0,0 +1,20 @@ |
|||
#!/usr/bin/env ruby |
|||
$:.unshift File.expand_path File.join File.dirname(__FILE__), '../../cryptcheck/lib' |
|||
require 'rubygems' |
|||
require 'bundler/setup' |
|||
|
|||
$TESTING = false |
|||
$CELLULOID_DEBUG = false |
|||
|
|||
require 'sidekiq/cli' |
|||
|
|||
begin |
|||
cli = Sidekiq::CLI.instance |
|||
cli.parse |
|||
cli.run |
|||
rescue => e |
|||
raise e if $DEBUG |
|||
STDERR.puts e.message |
|||
STDERR.puts e.backtrace.join("\n") |
|||
exit 1 |
|||
end |
Loading…
Reference in new issue