Skip to content

Commit

Permalink
what happens if we just...change it?
Browse files Browse the repository at this point in the history
  • Loading branch information
jamis committed Feb 2, 2024
1 parent 3329f15 commit 2e0f24c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mongo/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def initialize(server_session, client, options = {})
@server_session = server_session
options = options.dup

@client = client.use(:admin)
@client = client
@options = options.dup.freeze
@cluster_time = nil
@state = NO_TRANSACTION_STATE
Expand Down Expand Up @@ -1023,7 +1023,7 @@ def update_state!
# @since 2.5.0
# @api private
def validate!(client)
check_matching_cluster!(client)
check_matching_client!(client)
check_if_ended!
self
end
Expand Down Expand Up @@ -1199,8 +1199,8 @@ def check_if_ended!
raise Mongo::Error::InvalidSession.new(SESSION_ENDED_ERROR_MSG) if ended?
end

def check_matching_cluster!(client)
if @client.cluster != client.cluster
def check_matching_client!(client)
if @client != client
raise Mongo::Error::InvalidSession.new(MISMATCHED_CLUSTER_ERROR_MSG)
end
end
Expand Down

0 comments on commit 2e0f24c

Please sign in to comment.