async-container 0.16.13 → 0.17.0
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/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: 2f6471fbc90b1e7f77f1309460f4c7e4430b1145e7bed34fd2d3bf0328a07e2c
|
4
|
+
data.tar.gz: 2c31a4e9efa968ecb8990ea75635bfc3ae1f7dfbe4206b6924083ff70e41ac22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e238bdbbd25338102c6e50f94ab061d54ffbe297518ed2700f8e351bb96267e651042bf7a3284c518e6954e7dca5d09c3f1ca4ef043051b4fd128c71c1fe8a42
|
7
|
+
data.tar.gz: c3db488f41fab5ccea99a4cc8e89fc6e79cc687b77284f65991712beb51cc8d434e248d419d94fec5aaf04c63c91bfba037243d53c5ba6aa762645244053f04e
|
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
|
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.0
|
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-11 00:00:00.000000000 Z
|
45
45
|
dependencies:
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: async
|
metadata.gz.sig
CHANGED
Binary file
|