async-container 0.16.13 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/container/controller.rb +8 -6
- data/lib/async/container/generic.rb +1 -1
- data/lib/async/container/version.rb +2 -2
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca8c53ca974eedc0759ad1d030e4ccedc9aa223911a37954c1a60736ca97ec66
|
4
|
+
data.tar.gz: c1ea63c60f1b3d8890a9bff9bdf2ba07347bec4fb4c589da0cc6517382fa8ae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f5f2433accfc4f8e4f702a420df060eee14594ec03d260ce4f048349650edcd541ee7256010003a71b9164bd2ac152941c069dde5847e7e0db387b5da02a5fe
|
7
|
+
data.tar.gz: f352c280c2c6a5de77657e32cba0d256daa09bf0e14254a96b2e95983ed598ebdaa1f5e3e9e4d8c0029616caa29d8e83dd3e47b3382cb16a8a91e07d8081db9a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -22,8 +22,9 @@ module Async
|
|
22
22
|
|
23
23
|
# Initialize the controller.
|
24
24
|
# @parameter notify [Notify::Client] A client used for process readiness notifications.
|
25
|
-
def initialize(notify: Notify.open
|
25
|
+
def initialize(notify: Notify.open!, container_class: Container)
|
26
26
|
@container = nil
|
27
|
+
@container_class = container_class
|
27
28
|
|
28
29
|
if @notify = notify
|
29
30
|
@notify.status!("Initializing...")
|
@@ -66,7 +67,7 @@ module Async
|
|
66
67
|
# Can be overridden by a sub-class.
|
67
68
|
# @returns [Generic] A specific container instance to use.
|
68
69
|
def create_container
|
69
|
-
|
70
|
+
@container_class.new
|
70
71
|
end
|
71
72
|
|
72
73
|
# Whether the controller has a running container.
|
@@ -101,6 +102,7 @@ module Async
|
|
101
102
|
end
|
102
103
|
|
103
104
|
# Restart the container. A new container is created, and if successful, any old container is terminated gracefully.
|
105
|
+
# This is equivalent to a blue-green deployment.
|
104
106
|
def restart
|
105
107
|
if @container
|
106
108
|
@notify&.restarting!
|
@@ -114,8 +116,8 @@ module Async
|
|
114
116
|
|
115
117
|
begin
|
116
118
|
self.setup(container)
|
117
|
-
rescue
|
118
|
-
@notify&.error!(
|
119
|
+
rescue => error
|
120
|
+
@notify&.error!(error.to_s)
|
119
121
|
|
120
122
|
raise SetupError, container
|
121
123
|
end
|
@@ -126,7 +128,7 @@ module Async
|
|
126
128
|
Console.logger.debug(self, "Finished startup.")
|
127
129
|
|
128
130
|
if container.failed?
|
129
|
-
@notify&.error!(
|
131
|
+
@notify&.error!("Container failed to start!")
|
130
132
|
|
131
133
|
container.stop
|
132
134
|
|
@@ -165,7 +167,7 @@ module Async
|
|
165
167
|
Console.logger.debug(self, "Finished startup.")
|
166
168
|
|
167
169
|
if @container.failed?
|
168
|
-
@notify.error!("Container failed!")
|
170
|
+
@notify.error!("Container failed to reload!")
|
169
171
|
|
170
172
|
raise SetupError, @container
|
171
173
|
else
|
@@ -161,7 +161,7 @@ module Async
|
|
161
161
|
end
|
162
162
|
|
163
163
|
if status.success?
|
164
|
-
Console.logger.
|
164
|
+
Console.logger.debug(self) {"#{child} exited with #{status}"}
|
165
165
|
else
|
166
166
|
@statistics.failure!
|
167
167
|
Console.logger.error(self) {status}
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -41,7 +41,7 @@ cert_chain:
|
|
41
41
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
42
42
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
43
43
|
-----END CERTIFICATE-----
|
44
|
-
date: 2024-
|
44
|
+
date: 2024-03-22 00:00:00.000000000 Z
|
45
45
|
dependencies:
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: async
|
metadata.gz.sig
CHANGED
Binary file
|