fast_ci 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fast_ci/version.rb +1 -1
- data/lib/fast_ci.rb +13 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b81a68573c2f4000217c3783c48815e591f3b143ca185d6e379a0f7d27e1ac6e
|
4
|
+
data.tar.gz: e5d8b616c8739f83f48dd47e20db300a434161c9bea4a71ce9411802f537ef8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe3f867a2d7b7045ed9948d2779c5c7940414f5f2c724f992c97bcd368c31f8ead8f6c4e9da5d34fcbd274268aaeb6778aa582853c3ee386e9db54f8a62a745e
|
7
|
+
data.tar.gz: d8786cabc21ceddbee5826ce36dd874f0bcbbe4ff3f075b095a1bf3db693cc1d414d840474916822843ec59ab6b3c2c53ccd43f9a4d07564cd437addef899ae2
|
data/Gemfile.lock
CHANGED
data/lib/fast_ci/version.rb
CHANGED
data/lib/fast_ci.rb
CHANGED
@@ -113,7 +113,7 @@ module FastCI
|
|
113
113
|
|
114
114
|
def initialize(run_key)
|
115
115
|
@on = {}
|
116
|
-
@ref =
|
116
|
+
@ref = 1
|
117
117
|
@run_key = run_key
|
118
118
|
end
|
119
119
|
|
@@ -124,20 +124,24 @@ module FastCI
|
|
124
124
|
@on[event] = block
|
125
125
|
end
|
126
126
|
|
127
|
-
def send_msg(event, payload = {}, custom_topic = nil)
|
127
|
+
def send_msg(event, payload = {}, custom_topic = nil, custom_ref = nil)
|
128
128
|
FastCI.debug("ws#send_msg: #{event} -> #{payload.inspect}")
|
129
|
-
connection.write({ "topic": custom_topic || topic, "event": event, "payload": payload, "ref": ref })
|
129
|
+
connection.write({ "topic": custom_topic || topic, "event": event, "payload": payload, "ref": custom_ref || ref })
|
130
130
|
connection.flush
|
131
131
|
end
|
132
132
|
|
133
|
+
def get_connection
|
134
|
+
connection
|
135
|
+
end
|
136
|
+
|
133
137
|
def connect_to_ws
|
134
138
|
Async do |task|
|
135
139
|
before_start_connection
|
136
140
|
|
137
141
|
begin
|
138
142
|
Async::WebSocket::Client.connect(endpoint) do |connection|
|
139
|
-
after_start_connection
|
140
143
|
self.connection = connection
|
144
|
+
after_start_connection
|
141
145
|
self.task = task
|
142
146
|
yield
|
143
147
|
|
@@ -163,6 +167,7 @@ module FastCI
|
|
163
167
|
Async do
|
164
168
|
loop do
|
165
169
|
sleep 30
|
170
|
+
break if connection.closed?
|
166
171
|
send_heartbeat
|
167
172
|
end
|
168
173
|
end
|
@@ -170,7 +175,7 @@ module FastCI
|
|
170
175
|
|
171
176
|
def send_heartbeat
|
172
177
|
FastCI.debug("Sending heartbeat")
|
173
|
-
send_msg("heartbeat", {}, "phoenix")
|
178
|
+
send_msg("heartbeat", {}, "phoenix", 0)
|
174
179
|
end
|
175
180
|
|
176
181
|
def await(retry_count = 0)
|
@@ -182,6 +187,9 @@ module FastCI
|
|
182
187
|
FastCI.debug("ws#msg_received: #{message.inspect}")
|
183
188
|
|
184
189
|
response = message.dig(:payload, :response)
|
190
|
+
|
191
|
+
# Heartbeat
|
192
|
+
next if message.dig(:ref) == 0
|
185
193
|
|
186
194
|
case response&.dig(:event) || message[:event]
|
187
195
|
when "phx_error"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_ci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nesha Zoric
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: console
|