Skip to content

Commit

Permalink
Add mutex around stub api_requests
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwoods committed Dec 20, 2023
1 parent 6315c75 commit 3ce8e58
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gems/aws-sdk-core/lib/aws-sdk-core/client_stubs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ def setup_stubbing
@api_requests = []

requests = @api_requests
stub_mutex = @stub_mutex
self.handle do |context|
requests << {
operation_name: context.operation_name,
params: context.params,
context: context
}
stub_mutex.synchronize do
requests << {
operation_name: context.operation_name,
params: context.params,
context: context
}
end
@handler.call(context)
end
end
Expand Down

0 comments on commit 3ce8e58

Please sign in to comment.