mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
perhaps make more threadsafe
This commit is contained in:
parent
26cb64e9ce
commit
467dd39281
1 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
require 'fog/joyent'
|
require 'fog/joyent'
|
||||||
require 'fog/joyent/errors'
|
require 'fog/joyent/errors'
|
||||||
|
require 'thread'
|
||||||
|
|
||||||
module Fog
|
module Fog
|
||||||
module Joyent
|
module Joyent
|
||||||
|
@ -60,6 +61,7 @@ module Fog
|
||||||
def initialize(options = {})
|
def initialize(options = {})
|
||||||
@joyent_username = options[:joyent_username] || Fog.credentials[:joyent_username]
|
@joyent_username = options[:joyent_username] || Fog.credentials[:joyent_username]
|
||||||
@joyent_password = options[:joyent_password] || Fog.credentials[:joyent_password]
|
@joyent_password = options[:joyent_password] || Fog.credentials[:joyent_password]
|
||||||
|
@mutex = Mutex.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def request(opts)
|
def request(opts)
|
||||||
|
@ -161,8 +163,10 @@ module Fog
|
||||||
date = Time.now.utc.httpdate
|
date = Time.now.utc.httpdate
|
||||||
|
|
||||||
# Force KeyManager to load the key(s)
|
# Force KeyManager to load the key(s)
|
||||||
@key_manager.each_identity {}
|
@mutex.synchronize do
|
||||||
|
@key_manager.each_identity {}
|
||||||
|
end
|
||||||
|
|
||||||
key = @key_manager.known_identities.keys.first
|
key = @key_manager.known_identities.keys.first
|
||||||
|
|
||||||
sig = if key.kind_of? OpenSSL::PKey::RSA
|
sig = if key.kind_of? OpenSSL::PKey::RSA
|
||||||
|
|
Loading…
Add table
Reference in a new issue