futex 0.8.5 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile +1 -0
- data/futex.gemspec +1 -1
- data/lib/futex.rb +2 -1
- data/test/test_futex.rb +2 -2
- 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: a39e776160fae9f2f978b7f38b2eb93d1e36fdf1a9fe0fd6987d86fa17f39bcf
|
4
|
+
data.tar.gz: fcc63a92c287cea29dd530d12784b43e3140f41c0be505cf531821c835e7672d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4789faeaa4ba7042d0f11df6097fb202b2a79ac1a057dbce9a410ff88d00c0ce86c8a9207544f61292575d7cf1f4dd8f7ab55427297f5013b6894f3f9cc6b3e3
|
7
|
+
data.tar.gz: 0e5687638ad390464f890b2c881bccddc5d1d7cbe11100245e6dbcab9fdac29067563527dc781db457fa0a34341e842ff1173cbd50385c358394296ad6f1e4c6
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/futex.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.rubygems_version = '2.3.3'
|
32
32
|
s.required_ruby_version = '>=2.3'
|
33
33
|
s.name = 'futex'
|
34
|
-
s.version = '0.8.
|
34
|
+
s.version = '0.8.6'
|
35
35
|
s.license = 'MIT'
|
36
36
|
s.summary = 'File-based mutex'
|
37
37
|
s.description = 'Ruby Gem for file-based locking'
|
data/lib/futex.rb
CHANGED
@@ -115,7 +115,8 @@ class Futex
|
|
115
115
|
if Time.now - start > @timeout
|
116
116
|
raise CantLock.new("#{b} can't get #{prefix}exclusive access \
|
117
117
|
to the file #{@path} because of the lock at #{@lock}, after #{age(start)} \
|
118
|
-
of waiting: #{IO.read(@lock)} (modified #{age(File.mtime(@lock))} ago)",
|
118
|
+
of waiting: #{IO.read(@lock)} (modified #{age(File.mtime(@lock))} ago)",
|
119
|
+
File.mtime(@lock))
|
119
120
|
end
|
120
121
|
next unless (cycle % step).zero? && Time.now - start > @timeout / 2
|
121
122
|
debug("#{b} still waiting for #{prefix}exclusive \
|
data/test/test_futex.rb
CHANGED
@@ -82,14 +82,14 @@ class FutexTest < Minitest::Test
|
|
82
82
|
sleep 10
|
83
83
|
end
|
84
84
|
end
|
85
|
-
sleep
|
85
|
+
sleep 2
|
86
86
|
ex = assert_raises(Futex::CantLock) do
|
87
87
|
Futex.new(path, timeout: 0.1).open do |f|
|
88
88
|
# Will never reach this point
|
89
89
|
end
|
90
90
|
end
|
91
91
|
assert(ex.message.include?('can\'t get exclusive access to the file'), ex)
|
92
|
-
assert(
|
92
|
+
assert(ex.start < Time.now - 1)
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: futex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|