From: Bill Erickson Date: Wed, 9 Jun 2021 21:56:41 +0000 (-0400) Subject: LP1901930 Improve existing session detection X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=edbf3386ff692b205986fa68bb9fafb90d138553;p=working%2FEvergreen.git LP1901930 Improve existing session detection Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm index b767ce801a..7974990a22 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm @@ -130,8 +130,7 @@ sub set_ils_account { login_type => 'staff' }; - $args->{workstation} = $account->workstation->name - if $account->workstation; + $args->{workstation} = $account->workstation->name if $account->workstation; my $auth = $U->simplereq( 'open-ils.auth_internal', @@ -160,6 +159,12 @@ sub set_ils_account { $e->xact_begin; + # Always confirm a matching session does not exist before attempting + # to create one. + $ses = $e->retrieve_sip_session([ + $seskey, {flesh => 1, flesh_fields => {sipses => ['account']}}]) + unless $ses; + if ($ses) { # ILS token expired on an existing SIP session. # Update the session to use the new token.