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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 489544d7f2e5b00afafa91544b740ffa44cc85b3f99e6dd2bf4e5f031c825a5d
4
- data.tar.gz: 5bd94bdbb176fea865ee8353dd91319d4c8e6e455760ba4601c499405fd8e8a2
3
+ metadata.gz: 52edbe756c5a72dc0472f3f33cae2e600dae3479679d2eb8d131e645b528e78b
4
+ data.tar.gz: 8f69fa02d2d338ba14766524507948c3aef3cf864ebbd2dbd8b2272a37ef889b
5
5
  SHA512:
6
- metadata.gz: 4e096f348d8b97b8d4637f5884a51fbcb1b34fd5ba19e6b41af35e6ed9ce0bd22434dbd5b923d70aeb0350b4b8fc5e77692392a7613427a913bd727bb74cc756
7
- data.tar.gz: 60b41cebf121c933e7003ef8bdbf06bb9a667583f8bc74672fafa7d1378424c0906e68031a1912f469349565eaf04632fdb4e878c38b3e53d2a082f1d385ba70
6
+ metadata.gz: db1919466ba70e396903fe7067c41bccc45b6ede94af7950947106a74e91203ec793c7b73d054b3c8a5c33c3009b09bbc0f142f78c7c3f7c8db1a707378956b7
7
+ data.tar.gz: c0e06035cd7fd6745c0e344192a55bbf1c22d6aad6bb3a0ed0d8341b87b82b971060b3a9ae05e706a6af8a37f71c2f4d8c04c4d56dd80ad7177f30058bfca559
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RaceBlock
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
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
- return logger.debug("Token already exists") if RaceBlock.client.get(@key)
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.0
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-06-25 00:00:00.000000000 Z
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.4
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