race_block 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/race_block/version.rb +1 -1
- data/lib/race_block.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52edbe756c5a72dc0472f3f33cae2e600dae3479679d2eb8d131e645b528e78b
|
4
|
+
data.tar.gz: 8f69fa02d2d338ba14766524507948c3aef3cf864ebbd2dbd8b2272a37ef889b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db1919466ba70e396903fe7067c41bccc45b6ede94af7950947106a74e91203ec793c7b73d054b3c8a5c33c3009b09bbc0f142f78c7c3f7c8db1a707378956b7
|
7
|
+
data.tar.gz: c0e06035cd7fd6745c0e344192a55bbf1c22d6aad6bb3a0ed0d8341b87b82b971060b3a9ae05e706a6af8a37f71c2f4d8c04c4d56dd80ad7177f30058bfca559
|
data/lib/race_block/version.rb
CHANGED
data/lib/race_block.rb
CHANGED
@@ -51,6 +51,7 @@ module RaceBlock
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def self.start(key, expire: config.expire, expiration_delay: config.expiration_delay, **args)
|
54
|
+
raise("A Redis client must be added to the RaceBlock configuration") unless configuration.redis
|
54
55
|
raise("A key must be provided to start a RaceBlock") if key.empty?
|
55
56
|
|
56
57
|
@key = RaceBlock.key(key)
|
@@ -62,7 +63,8 @@ module RaceBlock
|
|
62
63
|
RaceBlock.client.expire(@key, 10) if RaceBlock.client.ttl(@key) == -1
|
63
64
|
|
64
65
|
# Token already exists
|
65
|
-
|
66
|
+
logger.debug("Token already exists") if RaceBlock.client.get(@key)
|
67
|
+
return
|
66
68
|
|
67
69
|
return unless set_token_and_wait(@key, **args)
|
68
70
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: race_block
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joey Paris
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
|
-
rubygems_version: 3.1.
|
141
|
+
rubygems_version: 3.1.6
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: A Ruby code block wrapper to help prevent race conditions across multiple
|