mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
chore: only gather notifications if not return_notifications?
This commit is contained in:
parent
ba5a7e2cb7
commit
dcd8f305b6
1 changed files with 11 additions and 12 deletions
|
@ -161,21 +161,20 @@ defmodule Ash.Engine do
|
|||
if opts[:return_notifications?] do
|
||||
resource_notifications
|
||||
else
|
||||
Ash.Notifier.notify(resource_notifications)
|
||||
end
|
||||
notifications = Ash.Notifier.notify(resource_notifications)
|
||||
|
||||
notifications =
|
||||
if Process.get(:ash_engine_started_transaction?) do
|
||||
current_notifications = Process.get(:ash_engine_notifications, [])
|
||||
if Process.get(:ash_engine_started_transaction?) do
|
||||
current_notifications = Process.get(:ash_engine_notifications, [])
|
||||
|
||||
Process.put(
|
||||
:ash_engine_notifications,
|
||||
current_notifications ++ notifications
|
||||
)
|
||||
Process.put(
|
||||
:ash_engine_notifications,
|
||||
current_notifications ++ notifications
|
||||
)
|
||||
|
||||
[]
|
||||
else
|
||||
notifications
|
||||
[]
|
||||
else
|
||||
notifications
|
||||
end
|
||||
end
|
||||
|
||||
{:ok, %{result | resource_notifications: notifications}}
|
||||
|
|
Loading…
Reference in a new issue