Skip to content

Commit

Permalink
Call after_expired after expiration
Browse files Browse the repository at this point in the history
Currently we call it within a transaction, but this doens't work as some
expiration triggers will send emails, and therefore try and fetch data
from the database while it's still within the transaction only.
  • Loading branch information
thomasleese committed Jul 11, 2024
1 parent a943605 commit 5af8492
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/services/expire_requestable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def call

ActiveRecord::Base.transaction do
requestable.expired!
requestable.after_expired(user:)

CreateTimelineEvent.call(
"requestable_expired",
Expand All @@ -25,6 +24,8 @@ def call
ApplicationFormStatusUpdater.call(user:, application_form:)
end

requestable.after_expired(user:)

requestable
end

Expand Down

0 comments on commit 5af8492

Please sign in to comment.