deploy-agent 1.0.3 → 1.1.0

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
  SHA1:
3
- metadata.gz: c5666da669ab691fb022b0aac942e60d8aa8afdc
4
- data.tar.gz: 0d8a3f0d94943ff242a8abcfd050436726aeb090
3
+ metadata.gz: 3aadc6e314dba14514c9015a73252decf65bb13f
4
+ data.tar.gz: fc71bae393b1edeff76eaee62e131f62f49fe989
5
5
  SHA512:
6
- metadata.gz: b5bf82122a25c4b5195b699803840be45dbf8b7bd44a4756370676402c951adc9cbd4b125e76c389b73d8ce18316e52bf80f6253d4e8e11a34f8d75b93de5ff0
7
- data.tar.gz: 6d140606f10cac74f035f012028d97785a6adc775102b07743b3273497b6c8bdcdc8d7548bbab04c21743cc2b549937f3695e0e632bec1346bbc1ebc49538562
6
+ metadata.gz: 10e1cd86b9db41700f5d9aa7013f12af2e6d159f6ba8e2645e46c8691a36ca33fba613e56540bcb7a53aa8d0c3d1d8e91a3a3fe59994a7c0d4caf45a8478daa6
7
+ data.tar.gz: cbbb62930a9504f883e51e9fca32ee824760902d333cd28de98a92eee7d645631d714dc86490b0d786848a48ea7a7b124bb5b985a35e05152a56d285711bb13f
@@ -1,5 +1,7 @@
1
- gem 'nio4r', '1.2.1'
1
+ gem 'nio4r', '2.1.0'
2
+ gem 'timers', '4.1.2'
2
3
  require 'nio'
4
+ require 'timers'
3
5
  require 'logger'
4
6
 
5
7
  module DeployAgent
@@ -7,14 +9,18 @@ module DeployAgent
7
9
 
8
10
  def run
9
11
  nio_selector = NIO::Selector.new
12
+ timers = Timers::Group.new
10
13
  target = ENV['DEPLOY_AGENT_PROXY_IP'] || 'agent.deployhq.com'
11
- ServerConnection.new(self, target, nio_selector, !ENV['DEPLOY_AGENT_NOVERIFY'])
12
-
14
+ server_connection = ServerConnection.new(self, target, nio_selector, !ENV['DEPLOY_AGENT_NOVERIFY'])
15
+ timers.every(60) { server_connection.keepalive }
13
16
  loop do
14
- nio_selector.select do |monitor|
17
+ wait_interval = timers.wait_interval
18
+ wait_interval = 0 if wait_interval < 0
19
+ nio_selector.select(wait_interval) do |monitor|
15
20
  monitor.value.rx_data if monitor.readable?
16
21
  monitor.value.tx_data if monitor.writeable?
17
22
  end
23
+ timers.fire
18
24
  end
19
25
  rescue ServerConnection::ServerDisconnected
20
26
  retry
@@ -158,6 +158,11 @@ module DeployAgent
158
158
  close
159
159
  end
160
160
 
161
+ def keepalive
162
+ @agent.logger.debug "Sending keepalive"
163
+ send_packet([7].pack('C'))
164
+ end
165
+
161
166
  private
162
167
 
163
168
  def close
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploy-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aTech Media
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-17 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nio4r
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.1
19
+ version: 2.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.1
26
+ version: 2.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: timers
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 4.1.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 4.1.2
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rb-readline
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
88
  version: '0'
75
89
  requirements: []
76
90
  rubyforge_project:
77
- rubygems_version: 2.6.8
91
+ rubygems_version: 2.6.11
78
92
  signing_key:
79
93
  specification_version: 4
80
94
  summary: The Deploy agent