slack-ruby-bot-server 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/slack-ruby-bot-server/ping.rb +32 -9
- data/lib/slack-ruby-bot-server/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08d2ca6a35e52167fede4422f6f7cb4e436aaf78'
|
4
|
+
data.tar.gz: 580793c0cddae73b27ddc7f65d26208d2b16bb1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f17072e2f9db331a104cf2b6ab1a111f90177240bd5c73eeb69d65673797cbc305913c7845e0d4d0693eededa00f85d51cd064fcf2ef76eb539ae50f90bf2dc8
|
7
|
+
data.tar.gz: 3136311a0f290eb8f714a8e7dab0fc5e65e02eaba7281dc05de1486c1b3d948f056f2cfe48c1de8f7395e3a4c5626ca0f61e5742c2f9ceb535024f0a7ee8913d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
### Changelog
|
2
2
|
|
3
|
+
#### 0.8.1 (2018/9/20)
|
4
|
+
|
5
|
+
* [#79](https://github.com/slack-ruby/slack-ruby-bot-server/pull/79): Fix: ping worker terminates on a failed restart - [@dblock](https://github.com/dblock).
|
6
|
+
|
3
7
|
#### 0.8.0 (2018/9/8)
|
4
8
|
|
5
9
|
* [#75](https://github.com/slack-ruby/slack-ruby-bot-server/pull/75): Default to `async-websocket` instead of `celluloid-io` - [@dblock](https://github.com/dblock).
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ A library that contains a [Grape](http://github.com/ruby-grape/grape) API servin
|
|
13
13
|
|
14
14
|
### Stable Release
|
15
15
|
|
16
|
-
You're reading the documentation for the **stable** release of slack-ruby-bot-server,
|
16
|
+
You're reading the documentation for the **stable** release of slack-ruby-bot-server, 0.8.1. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
17
17
|
|
18
18
|
### Try Me
|
19
19
|
|
@@ -68,20 +68,43 @@ module SlackRubyBotServer
|
|
68
68
|
@error_count += 1
|
69
69
|
return true if retries_left?
|
70
70
|
restart!
|
71
|
-
false
|
72
71
|
end
|
73
72
|
|
74
73
|
def restart!
|
75
74
|
logger.warn "RESTART: #{owner}"
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
close_connection
|
76
|
+
close_driver
|
77
|
+
emit_close
|
78
|
+
false
|
79
|
+
rescue StandardError => e
|
80
|
+
logger.warn "Error restarting team #{owner.id}: #{e.message}."
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
84
|
+
def close_connection
|
85
|
+
return unless connection
|
86
|
+
connection.close
|
87
|
+
rescue Async::Wrapper::Cancelled
|
88
|
+
# ignore, from connection.close
|
89
|
+
rescue StandardError => e
|
90
|
+
logger.warn "Error closing connection for #{owner.id}: #{e.message}."
|
91
|
+
raise e
|
92
|
+
end
|
93
|
+
|
94
|
+
def close_driver
|
95
|
+
return unless driver
|
81
96
|
driver.close
|
97
|
+
rescue StandardError => e
|
98
|
+
logger.warn "Error closing driver for #{owner.id}: #{e.message}."
|
99
|
+
raise e
|
100
|
+
end
|
101
|
+
|
102
|
+
def emit_close
|
103
|
+
return unless driver
|
82
104
|
driver.emit(:close, WebSocket::Driver::CloseEvent.new(1001, 'bot offline'))
|
83
105
|
rescue StandardError => e
|
84
|
-
logger.warn "Error
|
106
|
+
logger.warn "Error sending :close event to driver for #{owner.id}: #{e.message}."
|
107
|
+
raise e
|
85
108
|
end
|
86
109
|
|
87
110
|
def ping_interval
|
@@ -89,11 +112,11 @@ module SlackRubyBotServer
|
|
89
112
|
end
|
90
113
|
|
91
114
|
def retries_left?
|
92
|
-
|
115
|
+
retry_count - error_count >= 0
|
93
116
|
end
|
94
117
|
|
95
118
|
def retries_left
|
96
|
-
retry_count - error_count
|
119
|
+
[0, retry_count - error_count].max
|
97
120
|
end
|
98
121
|
|
99
122
|
def retry_count
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-ruby-bot-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Doubrovkine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-websocket
|
@@ -295,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
295
|
version: '0'
|
296
296
|
requirements: []
|
297
297
|
rubyforge_project:
|
298
|
-
rubygems_version: 2.6.
|
298
|
+
rubygems_version: 2.6.13
|
299
299
|
signing_key:
|
300
300
|
specification_version: 4
|
301
301
|
summary: A Grape API serving a Slack bot to multiple teams.
|