Browse Source

Better binaries

new-scoring
aeris 2 years ago
parent
commit
88c4151328
7 changed files with 47 additions and 30 deletions
  1. 0
    10
      bin/enqueue
  2. 1
    0
      bin/enqueue
  3. 22
    0
      bin/enqueue.rb
  4. 3
    0
      bin/runner
  5. 0
    20
      bin/sidekiq
  6. 1
    0
      bin/sidekiq
  7. 20
    0
      bin/sidekiq.rb

+ 0
- 10
bin/enqueue View File

@@ -1,10 +0,0 @@
1
-#!/usr/bin/env ruby
2
-require 'sidekiq'
3
-options      = {
4
-		url:       ENV['REDIS_URL'],
5
-		namespace: :cryptcheck
6
-}
7
-client       = Sidekiq::Client.new Sidekiq::RedisConnection.create options
8
-clazz, *args = ARGV
9
-clazz += 'Worker'
10
-client.push({ 'class' => clazz, 'args' => args })

+ 1
- 0
bin/enqueue View File

@@ -0,0 +1 @@
1
+runner

+ 22
- 0
bin/enqueue.rb View File

@@ -0,0 +1,22 @@
1
+#!/usr/bin/env ruby
2
+ENV['RAILS_ENV'] ||= 'development'
3
+require 'dotenv'
4
+Dotenv.load ".env.#{ENV['RAILS_ENV']}", '.env'
5
+
6
+if ENV['RAILS_ENV'] == 'development'
7
+	DIR = File.dirname File.dirname File.expand_path __FILE__
8
+	require File.join DIR, 'config/environment'
9
+	ENV['RAILS_ENV'] = 'test'
10
+	require 'sidekiq/testing/inline'
11
+end
12
+
13
+require 'sidekiq'
14
+options      = {
15
+		url:       ENV['REDIS_URL'],
16
+		namespace: :cryptcheck
17
+}
18
+client       = Sidekiq::Client.new Sidekiq::RedisConnection.create options
19
+
20
+clazz, *args = ARGV
21
+clazz        += 'Worker'
22
+client.push({ 'class' => clazz, 'args' => args })

+ 3
- 0
bin/runner View File

@@ -0,0 +1,3 @@
1
+#!/bin/bash
2
+DIR="$(readlink -m "$(dirname "$0")")"
3
+LD_LIBRARY_PATH="${DIR}/../../cryptcheck/lib" "${0}.rb" $*

+ 0
- 20
bin/sidekiq View File

@@ -1,20 +0,0 @@
1
-#!/usr/bin/env ruby
2
-$:.unshift File.expand_path File.join File.dirname(__FILE__), '../../cryptcheck/lib'
3
-require 'rubygems'
4
-require 'bundler/setup'
5
-
6
-$TESTING = false
7
-$CELLULOID_DEBUG = false
8
-
9
-require 'sidekiq/cli'
10
-
11
-begin
12
-	cli = Sidekiq::CLI.instance
13
-	cli.parse
14
-	cli.run
15
-rescue => e
16
-	raise e if $DEBUG
17
-	STDERR.puts e.message
18
-	STDERR.puts e.backtrace.join("\n")
19
-	exit 1
20
-end

+ 1
- 0
bin/sidekiq View File

@@ -0,0 +1 @@
1
+runner

+ 20
- 0
bin/sidekiq.rb View File

@@ -0,0 +1,20 @@
1
+#!/usr/bin/env ruby
2
+$:.unshift File.expand_path File.join File.dirname(__FILE__), '../../cryptcheck/lib'
3
+require 'rubygems'
4
+require 'bundler/setup'
5
+
6
+$TESTING = false
7
+$CELLULOID_DEBUG = false
8
+
9
+require 'sidekiq/cli'
10
+
11
+begin
12
+	cli = Sidekiq::CLI.instance
13
+	cli.parse
14
+	cli.run
15
+rescue => e
16
+	raise e if $DEBUG
17
+	STDERR.puts e.message
18
+	STDERR.puts e.backtrace.join("\n")
19
+	exit 1
20
+end

Loading…
Cancel
Save