chillout 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,5 +20,10 @@ module Chillout
20
20
  rescue HttpClient::NotReceived => e
21
21
  CheckResult.new(e)
22
22
  end
23
+
24
+ def send_startup_message
25
+ @server_side.send_startup_message
26
+ rescue HttpClient::NotReceived => e
27
+ end
23
28
  end
24
29
  end
@@ -22,6 +22,12 @@ module Chillout
22
22
  @http_client.get('/check')
23
23
  end
24
24
 
25
+ def send_startup_message
26
+ @http_client.post('/clients', {
27
+ :message => 'worker started'
28
+ })
29
+ end
30
+
25
31
  private
26
32
  def timestamp
27
33
  Time.now.iso8601
@@ -1,3 +1,3 @@
1
1
  module Chillout
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -37,7 +37,13 @@ module Chillout
37
37
  logger.error "Sending metrics failed"
38
38
  end
39
39
 
40
+ def send_startup_message
41
+ dispatcher.send_startup_message
42
+ logger.info "Sending startup message"
43
+ end
44
+
40
45
  def run
46
+ send_startup_message
41
47
  loop do
42
48
  containers_to_merge = get_all_containers_to_process
43
49
  creations_container = merge_containers(containers_to_merge)
@@ -7,6 +7,7 @@ module Chillout
7
7
 
8
8
  def setup
9
9
  api_key = "xyz123"
10
+ stub_api_request(api_key, "clients")
10
11
  stub_api_request(api_key, "metrics")
11
12
  @config = Chillout::Config.new(api_key)
12
13
  @client = Chillout::Client.new(@config)
data/test/worker_test.rb CHANGED
@@ -36,5 +36,10 @@ module Chillout
36
36
  @queue.expects(:<<).with(:creations_container)
37
37
  @worker.send_creations(:creations_container)
38
38
  end
39
+
40
+ def test_send_startup_message_is_delegated_to_dispatcher
41
+ @dispatcher.expects(:send_startup_message)
42
+ @worker.send_startup_message
43
+ end
39
44
  end
40
45
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chillout
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 4
9
- - 1
10
- version: 0.4.1
8
+ - 5
9
+ - 0
10
+ version: 0.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Micha\xC5\x82 \xC5\x81omnicki"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-03-27 00:00:00 Z
19
+ date: 2013-03-29 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: json