Skip to content

Commit 8e3f385

Browse files
committed
Drop dependency on mutex_m
1 parent a380f48 commit 8e3f385

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/github_authentication/provider.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
# frozen_string_literal: true
2-
require "mutex_m.rb"
3-
42
require 'github_authentication/retriable'
53

64
module GithubAuthentication
75
class Provider
86
include Retriable
9-
include Mutex_m
107

118
Error = Class.new(StandardError)
129
TokenGeneratorError = Class.new(Error)
1310

1411
def initialize(generator:, cache:)
15-
super()
1612
@token = nil
1713
@generator = generator
1814
@cache = cache
15+
@mutex = Mutex.new
1916
end
2017

2118
def token(seconds_ttl: 5 * 60)
2219
return @token if @token&.valid_for?(seconds_ttl)
2320

2421
with_retries(TokenGeneratorError) do
25-
mu_synchronize do
22+
@mutex.synchronize do
2623
return @token if @token&.valid_for?(seconds_ttl)
2724

2825
if (@token = @cache.read)

0 commit comments

Comments
 (0)