herdst_worker 0.1.17 → 0.2.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: 1b45d2b8b64393572992a4434666e432d575d1e39a6ac58acd4df8f1e0b47093
4
- data.tar.gz: 411618b99c38009946b4efd8a626c9c7d8ba98637b906e6d21ac1b01644b8b7a
3
+ metadata.gz: f9e44d9ada2a49ef3b502234a2567cd9020d0918d1fcfc4fbbe8f1824a15503f
4
+ data.tar.gz: 339f71235cfbae588ce2f3858a4ca2a9204ac47918d6411069b996022850aa08
5
5
  SHA512:
6
- metadata.gz: b0594c4b157d7aa04cca531f90e91401006a85494033862b0f1b33bb184405292b827be25572175d89773cb597796864d977972982b2d6084ba8845cf222a902
7
- data.tar.gz: 2147d0bfb758ca0dd69cc5c8e90ac36b993f05b6162d94cdc48c4de8ccd103af180844f3ca6469d2b056d7a03410f2afdaa6910d1b4cb4f0e71178235edaccdf
6
+ metadata.gz: 968159200ad0fecd8c7f485bb883703741770495d72a59093a282b0b9eca96353ce13d73b2066278e8d12133272090c30741363cb91d8389c40e73cf8f947c42
7
+ data.tar.gz: 2b40426599b5a9507b62f70b80cc474bbe81af722bd1a9a6ec385e4d18dcfdb1bae45380445e89461dfaef3d2200cee9b3f8455c50b8f427ec35f5c752fb8aef
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
 
@@ -6,17 +6,19 @@ 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"] || "development"
12
13
 
13
14
  raise "Please specify a name for the application E.g. --name=[name]" unless application_name
15
+ raise "Please specify a family for the application E.g. --family=[family]" unless application_family
14
16
 
15
17
  require "irb"
16
18
  require "irb/completion"
17
19
  require_relative "../lib/herdst_worker"
18
20
 
19
- application_instance = HerdstWorker::Application.new(application_env, application_name, false)
21
+ application_instance = HerdstWorker::Application.new(application_env, application_name, application_family, false)
20
22
 
21
23
  require_relative application_path
22
24
 
@@ -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.1'
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.1
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-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport