specwrk 0.16.0 → 0.16.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/lib/specwrk/version.rb +1 -1
- data/lib/specwrk/web/endpoints/base.rb +13 -1
- data/lib/specwrk/worker.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1dc8711d21ad65ad789e80317fb8fb61e2eda33397cfbb5aaf7de6209429781
|
4
|
+
data.tar.gz: 3d25ac4538e24d6a9190593b66a1510677c17f10c6f66dd3a30e3d815091937c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86325f95bb29b0b739fa9104f3be207bd275df083a9a778bde7c941b405a6579fba8a7bff5a36bc121ef18f2ca64de9fb3716b12307b2a6ba84c24743c72dafc
|
7
|
+
data.tar.gz: 56fcb244c3a59405c738a0a5bf33b3a98d2a44f12d76fe129b745331de69625c13bf23537eb826df5ee00115c6bf02bb2fea81ff0f51622eb2f33faa1a34bd9c
|
data/lib/specwrk/version.rb
CHANGED
@@ -8,6 +8,8 @@ module Specwrk
|
|
8
8
|
class Web
|
9
9
|
module Endpoints
|
10
10
|
class Base
|
11
|
+
MUTEX = Mutex.new
|
12
|
+
|
11
13
|
attr_reader :started_at
|
12
14
|
|
13
15
|
def initialize(request)
|
@@ -134,7 +136,17 @@ module Specwrk
|
|
134
136
|
if skip_lock
|
135
137
|
yield
|
136
138
|
else
|
137
|
-
|
139
|
+
with_mutex do
|
140
|
+
Store.with_lock(URI(ENV.fetch("SPECWRK_SRV_STORE_URI", "memory:///")), run_id) { yield }
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def with_mutex
|
146
|
+
if Thread.current == Thread.main
|
147
|
+
yield
|
148
|
+
else
|
149
|
+
MUTEX.synchronize { yield }
|
138
150
|
end
|
139
151
|
end
|
140
152
|
end
|
data/lib/specwrk/worker.rb
CHANGED
@@ -70,6 +70,7 @@ module Specwrk
|
|
70
70
|
|
71
71
|
def execute
|
72
72
|
executor.run next_examples
|
73
|
+
@next_examples = nil
|
73
74
|
complete_examples
|
74
75
|
rescue UnhandledResponseError => e
|
75
76
|
# If fetching examples via next_exampels fails we can just try again so warn and return
|
@@ -98,7 +99,7 @@ module Specwrk
|
|
98
99
|
sleep 10
|
99
100
|
|
100
101
|
begin
|
101
|
-
client.heartbeat if client.last_request_at.nil? || client.last_request_at < Time.now -
|
102
|
+
client.heartbeat if client.last_request_at.nil? || client.last_request_at < Time.now - 9
|
102
103
|
rescue
|
103
104
|
warn "Heartbeat failed!"
|
104
105
|
end
|