lib/race_block.rb in race_block-0.2.1 vs lib/race_block.rb in race_block-0.2.2

- old
+ new

@@ -61,11 +61,14 @@ # `-1` means the key is set but does not expire, `-2` means the key is # not set RaceBlock.client.expire(@key, 10) if RaceBlock.client.ttl(@key) == -1 # Token already exists - logger.debug("Token already exists") if RaceBlock.client.get(@key) - return + # todo: Revoke version 0.2.1 because it always return nil no matter what (never committed but released because I'm not a smart man) + if RaceBlock.client.get(@key) + logger.debug("Token already exists") + return + end return unless set_token_and_wait(@key, **args) RaceBlock.client.expire(@key, expire) logger.debug("Running block")