herdst_worker 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9d5a5ffa6aa3b5fcfeae78e88aee46567078ed0c34c751f4d0396a523debbb8
|
4
|
+
data.tar.gz: 52ce41c7f10e65a8dea9b7e3afb3163ea8604bad592bc3b5606b5dc1890b70b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48b2860290db0874e6da4f037511f9c4634df933154a771c5c9d3f535e8f8887e2bd91ea7dd8f3983ed1406dbf0318d32deca935f8891cc1e38d31bc3e97ff53
|
7
|
+
data.tar.gz: 398ebb6a28106cf7693e7b6fc55c8dd0eba03f29c36032c00da88466ab076bbb8712c78652c26c36e70a7f0668d9b5145d72c5bb4ab026eed18c11141bce6635
|
data/bin/herdst_worker
CHANGED
@@ -2,11 +2,14 @@
|
|
2
2
|
|
3
3
|
args = Hash[ ARGV.flat_map { |s| s.scan(/--?([^=\s]+)(?:=(\S+))?/) } ]
|
4
4
|
|
5
|
+
application_name = args["name"]
|
5
6
|
application_file = args["application"] || "application.rb"
|
6
7
|
application_path = "#{Dir.pwd}/#{application_file}"
|
7
8
|
application_env = args["env"] || "production"
|
8
9
|
queue_enabled = args["queue_enabled"] == "false" ? false : true
|
9
10
|
|
11
|
+
raise "Please specify a name for the application E.g. --name=[name]" unless application_name.present?
|
12
|
+
|
10
13
|
require_relative "../lib/herdst_worker"
|
11
14
|
|
12
15
|
application_instance = HerdstWorker::Application.new(application_env, queue_enabled)
|
@@ -15,14 +15,15 @@ module HerdstWorker
|
|
15
15
|
attr_accessor :poller_enabled, :queues, :poller_url, :queue
|
16
16
|
|
17
17
|
|
18
|
-
def initialize(env, poller_enabled)
|
18
|
+
def initialize(env, name, poller_enabled)
|
19
|
+
self.name = name
|
19
20
|
self.poller_enabled = poller_enabled
|
20
21
|
self.queues = ActiveSupport::HashWithIndifferentAccess.new
|
21
22
|
|
22
23
|
HerdstWorker.set_application(self)
|
23
24
|
|
24
25
|
self.logger = HerdstWorker::Log::Facade.new(get_logger_level(env))
|
25
|
-
self.config = HerdstWorker::Configuration::Facade.new(env)
|
26
|
+
self.config = HerdstWorker::Configuration::Facade.new(env, name)
|
26
27
|
self.autoload = HerdstWorker::Autoload::Facade.new(self)
|
27
28
|
self.set_inflections
|
28
29
|
|
@@ -13,11 +13,11 @@ module HerdstWorker
|
|
13
13
|
attr_accessor :env, :metadata, :paths, :actions
|
14
14
|
|
15
15
|
|
16
|
-
def initialize(env)
|
16
|
+
def initialize(env, name)
|
17
17
|
self.env = env.downcase
|
18
18
|
|
19
19
|
self.paths = Paths.new
|
20
|
-
self.metadata = Metadata.new(env, self)
|
20
|
+
self.metadata = Metadata.new(env, name, self)
|
21
21
|
self.actions = self.config_for(:actions)
|
22
22
|
end
|
23
23
|
|
@@ -13,10 +13,10 @@ module HerdstWorker
|
|
13
13
|
attr_accessor :config_suffix, :secrets_suffix
|
14
14
|
|
15
15
|
|
16
|
-
def initialize(env, config)
|
16
|
+
def initialize(env, name, config)
|
17
17
|
self.config = config
|
18
|
-
self.config_suffix = "-service-config"
|
19
|
-
self.secrets_suffix = "-service-secrets"
|
18
|
+
self.config_suffix = "-#{name}-service-config"
|
19
|
+
self.secrets_suffix = "-#{name}-service-secrets"
|
20
20
|
|
21
21
|
self.secrets = {}.with_indifferent_access
|
22
22
|
self.secrets["ENV"] = env
|