herdst_worker 0.1.17 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b45d2b8b64393572992a4434666e432d575d1e39a6ac58acd4df8f1e0b47093
4
- data.tar.gz: 411618b99c38009946b4efd8a626c9c7d8ba98637b906e6d21ac1b01644b8b7a
3
+ metadata.gz: 1605793b8363c3ac763ee5995f8460265dbfdfa35785d896c0f82e09913fac1a
4
+ data.tar.gz: 6bf7233eb33cc88ac68f3a1ed7d3584ed0a5a59f78d678ec1be420f9a73dac7f
5
5
  SHA512:
6
- metadata.gz: b0594c4b157d7aa04cca531f90e91401006a85494033862b0f1b33bb184405292b827be25572175d89773cb597796864d977972982b2d6084ba8845cf222a902
7
- data.tar.gz: 2147d0bfb758ca0dd69cc5c8e90ac36b993f05b6162d94cdc48c4de8ccd103af180844f3ca6469d2b056d7a03410f2afdaa6910d1b4cb4f0e71178235edaccdf
6
+ metadata.gz: e1baa0fdbcd6793e1cd47aff996e451c5bf55c61f1be26132723ab6dab31ef9d78477bd6812fa1fce3012f3046044e4a535a9aa9fc4988963bcd9047d8856727
7
+ data.tar.gz: 44969cc08a9e2f8848c25fc24e2e37f9c9eb35e5ff264f075ae53a27a40eabcfbc40d4af8ba2367a132c996ac71259361443136c22670d4f577f2682dd7ed1d7
data/ReadMe.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  1. Update version in `lib/herdst_worker/version.rb`
4
4
  2. run `gem build herdst_worker.gemspec`
5
- 3. run `gem push gem push herdst_worker-x.x.x.gem`
5
+ 3. run `gem push herdst_worker-x.x.x.gem`
data/bin/herdst_worker CHANGED
@@ -6,16 +6,18 @@ args = ARGV
6
6
 
7
7
  arg_pair = Hash[ args ]
8
8
  application_name = arg_pair["name"]
9
+ application_family = arg_pair["family"]
9
10
  application_file = arg_pair["application"] || "application.rb"
10
11
  application_path = "#{Dir.pwd}/#{application_file}"
11
12
  application_env = arg_pair["env"] || "production"
12
13
  queue_enabled = arg_pair["queue_enabled"] == "false" ? false : true
13
14
 
14
15
  raise "Please specify a name for the application E.g. --name=[name]" unless application_name
16
+ raise "Please specify a family for the application E.g. --family=[family]" unless application_family
15
17
 
16
18
  require_relative "../lib/herdst_worker"
17
19
 
18
- application_instance = HerdstWorker::Application.new(application_env, application_name, queue_enabled)
20
+ application_instance = HerdstWorker::Application.new(application_env, application_name, application_family, queue_enabled)
19
21
 
20
22
  require_relative application_path
21
23
 
@@ -10,13 +10,14 @@ module HerdstWorker
10
10
  class Application
11
11
 
12
12
 
13
- attr_accessor :name
13
+ attr_accessor :name, :family
14
14
  attr_accessor :logger, :config, :autoload
15
15
  attr_accessor :poller_enabled, :queues, :poller_url, :queue
16
16
 
17
17
 
18
- def initialize(env, name, poller_enabled)
18
+ def initialize(env, name, family, poller_enabled)
19
19
  self.name = name
20
+ self.family = family
20
21
  self.poller_enabled = poller_enabled
21
22
  self.queues = ActiveSupport::HashWithIndifferentAccess.new
22
23
 
@@ -99,7 +99,7 @@ module HerdstWorker
99
99
 
100
100
  # Build data
101
101
  data = Hash.new
102
- data[:app] = self.app.name
102
+ data[:app] = self.app.family || self.app.name
103
103
  data[:app_id] = company.id
104
104
  data[:app_name] = company.name
105
105
  data[:app_slug] = company.get_host_name
@@ -217,7 +217,7 @@ module HerdstWorker
217
217
  private
218
218
  def reset_time
219
219
  self.start_time = Time.now.utc.to_i
220
- self.restart_time = self.start_time + (3600 * 6) # Four hours
220
+ self.restart_time = self.start_time + (3600 * 6) # Six hours
221
221
  end
222
222
 
223
223
  end
@@ -1,3 +1,3 @@
1
1
  module HerdstWorker
2
- VERSION = '0.1.17'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herdst_worker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Herd.St
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport