rocketjob 5.0.0.beta2 → 5.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rocket_job/cli.rb +16 -6
- data/lib/rocket_job/version.rb +1 -1
- data/lib/rocket_job/worker.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a9461707111b2196affa91073e002da7664503f5a31aa1718745502e8b677ed
|
4
|
+
data.tar.gz: b1aff5d9bd88c754de93454f699821f5d598767e30830d3456ff289ae0ed7525
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c61f05e4bd981ce85d199758bc6211256f9fa1408196c9f0168821d79ba8eb4d9e403db2fa91ed5de4a00b20545aadca051bdbd3fd586b9340c6e06430c91f28
|
7
|
+
data.tar.gz: 4ba190a069d7fa2ed7f0a684e1f32e6d7ff6f6a6838df8d082016cecc62d83207522393e6bca0c7a25370a8bfb0986a3f4db51a055a8629df4fa10f8fcac57f6
|
data/lib/rocket_job/cli.rb
CHANGED
@@ -9,7 +9,8 @@ module RocketJob
|
|
9
9
|
class CLI
|
10
10
|
include SemanticLogger::Loggable
|
11
11
|
attr_accessor :environment, :pidfile, :directory, :quiet,
|
12
|
-
:log_level, :log_file, :mongo_config, :symmetric_encryption_config
|
12
|
+
:log_level, :log_file, :mongo_config, :symmetric_encryption_config,
|
13
|
+
:max_workers, :include_filter, :exclude_filter, :where_filter
|
13
14
|
|
14
15
|
def initialize(argv)
|
15
16
|
@quiet = false
|
@@ -32,6 +33,7 @@ module RocketJob
|
|
32
33
|
setup_environment
|
33
34
|
setup_logger
|
34
35
|
rails? ? boot_rails : boot_standalone
|
36
|
+
override_config
|
35
37
|
write_pidfile
|
36
38
|
|
37
39
|
# In case Rails did not load the Mongoid Config
|
@@ -104,6 +106,14 @@ module RocketJob
|
|
104
106
|
self.class.eager_load_jobs
|
105
107
|
end
|
106
108
|
|
109
|
+
# Allow the CLI to override the configuration after rails has been loaded.
|
110
|
+
def override_config
|
111
|
+
Config.max_workers = max_workers if max_workers
|
112
|
+
Config.include_filter = include_filter if include_filter
|
113
|
+
Config.exclude_filter = exclude_filter if exclude_filter
|
114
|
+
Config.where_filter = where_filter if where_filter
|
115
|
+
end
|
116
|
+
|
107
117
|
# Create a PID file if requested
|
108
118
|
def write_pidfile
|
109
119
|
return unless pidfile
|
@@ -152,20 +162,20 @@ module RocketJob
|
|
152
162
|
Config.name = arg
|
153
163
|
end
|
154
164
|
o.on('-w', '--workers COUNT', 'Number of workers (threads) to start') do |arg|
|
155
|
-
|
165
|
+
@max_workers = arg.to_i
|
156
166
|
end
|
157
167
|
o.on('--include REGEXP', 'Limit this server to only those job classes that match this regular expression (case-insensitive). Example: "DirmonJob|WeeklyReportJob"') do |arg|
|
158
|
-
|
168
|
+
@include_filter = Regexp.new(arg, true)
|
159
169
|
end
|
160
170
|
o.on('-F', '--filter REGEXP', 'DEPRECATED. Use --include') do |arg|
|
161
171
|
warn '-F and --filter are deprecated, use --include'
|
162
|
-
|
172
|
+
@include_filter = Regexp.new(arg, true)
|
163
173
|
end
|
164
174
|
o.on('-E', '--exclude REGEXP', 'Prevent this server from working on any job classes that match this regular expression (case-insensitive). Example: "DirmonJob|WeeklyReportJob"') do |arg|
|
165
|
-
|
175
|
+
@exclude_filter = Regexp.new(arg, true)
|
166
176
|
end
|
167
177
|
o.on('-W', '--where JSON', "Limit this server instance to the supplied mongo query filter. Supply as a string in JSON format. Example: '{\"priority\":{\"$lte\":25}}'") do |arg|
|
168
|
-
|
178
|
+
@where_filter = JSON.parse(arg)
|
169
179
|
end
|
170
180
|
o.on('-q', '--quiet', 'Do not write to stdout, only to logfile. Necessary when running as a daemon') do
|
171
181
|
@quiet = true
|
data/lib/rocket_job/version.rb
CHANGED
data/lib/rocket_job/worker.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketjob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0.
|
4
|
+
version: 5.0.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|