Retry store_lti_session_data

We need to store or update the LTI parameters. However, this operation is not atomic and multiple requests can interfere with our database operation. Therefore, we need to retry in case the record is not unique.

Fixes CODEOCEAN-TC
This commit is contained in:
Sebastian Serth
2023-08-28 22:20:46 +02:00
parent f61bf81ca9
commit 6eed794aa0

View File

@ -225,6 +225,8 @@ module Lti
@lti_parameters.save!
session[:external_user_id] = current_user.id
rescue ActiveRecord::RecordNotUnique
retry
end
private :store_lti_session_data