Skip to content

Commit fcc6b2a

Browse files
Make EmbedWorkflow::Client thread-safe (#13)
1 parent b14791f commit fcc6b2a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/embed_workflow/client.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ module Client
77
BASE_API_URL = "https://embedworkflow.com/".freeze
88

99
def client
10-
return @client if defined?(@client)
11-
@client = create_connection(URI.parse(BASE_API_URL))
12-
@client.use_ssl = true
13-
14-
@client
10+
create_connection(URI.parse(BASE_API_URL)).tap do |client|
11+
client.use_ssl = true
12+
end
1513
end
1614

1715
def get_request(path:, auth: true, params: {})

0 commit comments

Comments
 (0)