barbeque 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/barbeque/version.rb +1 -1
- data/lib/barbeque/worker.rb +16 -8
- data/lib/tasks/barbeque_tasks.rake +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4189910f9a93c337aa4baf8491098e3c5cfb0d83
|
4
|
+
data.tar.gz: 8d460cc32edf6f00514f2448b583ee0e5c857977
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c50e0ef9258dd7b9fce1940dd4ef3d60d7b0eb29e6d9dc54456de19549c2ce45ccaf56f67f2487e43bb5394d3f026caae42964008e059796ecf3f1f1db4127a
|
7
|
+
data.tar.gz: 766e2abd01645473c086649441b3f3753a43e6f776d9ea49a28677f258102a60e63f37a557c356159caff8e2aa7b500b17db221ce4dee3726da7c8c04dc4bf7f
|
data/lib/barbeque/version.rb
CHANGED
data/lib/barbeque/worker.rb
CHANGED
@@ -8,15 +8,23 @@ module Barbeque
|
|
8
8
|
|
9
9
|
DEFAULT_QUEUE = 'default'
|
10
10
|
|
11
|
-
def self.run
|
11
|
+
def self.run(
|
12
|
+
worker_type: 'process',
|
13
|
+
workers: 4,
|
14
|
+
daemonize: false,
|
15
|
+
log: $stdout,
|
16
|
+
log_level: :info,
|
17
|
+
pid_path: '/tmp/barbeque_worker.pid',
|
18
|
+
supervisor: true
|
19
|
+
)
|
12
20
|
options = {
|
13
|
-
worker_type:
|
14
|
-
workers:
|
15
|
-
daemonize:
|
16
|
-
log:
|
17
|
-
log_level:
|
18
|
-
pid_path:
|
19
|
-
supervisor:
|
21
|
+
worker_type: worker_type,
|
22
|
+
workers: workers,
|
23
|
+
daemonize: daemonize,
|
24
|
+
log: log,
|
25
|
+
log_level: log_level,
|
26
|
+
pid_path: pid_path,
|
27
|
+
supervisor: supervisor,
|
20
28
|
}
|
21
29
|
|
22
30
|
worker = ServerEngine.create(nil, Barbeque::Worker, options)
|
@@ -2,8 +2,15 @@ namespace :barbeque do
|
|
2
2
|
desc 'Start worker to execute jobs'
|
3
3
|
task worker: :environment do
|
4
4
|
ENV['BARBEQUE_QUEUE'] ||= 'default'
|
5
|
-
|
6
5
|
require 'barbeque/worker'
|
7
|
-
|
6
|
+
|
7
|
+
Barbeque::Worker.run(
|
8
|
+
workers: (ENV['BARBEQUE_WORKER_NUM'] || 4).to_i,
|
9
|
+
daemonize: ENV['DAEMONIZE_BARBEQUE'] == '1',
|
10
|
+
log: ENV['BARBEQUE_LOG_TO_STDOUT'] == '1' ? $stdout : Rails.root.join('log/barbeque_worker.log').to_s,
|
11
|
+
log_level: Rails.env.production? ? :info : :debug,
|
12
|
+
pid_path: Rails.root.join('tmp/pids/barbeque_worker.pid').to_s,
|
13
|
+
supervisor: Rails.env.production?,
|
14
|
+
)
|
8
15
|
end
|
9
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barbeque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: adminlte2-rails
|