mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
fix: flush engine state always
This commit is contained in:
parent
afc74b7a89
commit
b2ae6dc3ea
3 changed files with 10 additions and 11 deletions
|
@ -65,7 +65,6 @@ Combining them will result in an error on the query.
|
|||
- Can't go to a specific page number
|
||||
- Can't use aggregate and calculation sorting
|
||||
|
||||
|
||||
For more information on keyset vs offset based pagination, see:
|
||||
|
||||
- [Offset vs Seek Pagination](https://taylorbrazelton.com/posts/2019/03/offset-vs-seek-pagination/)
|
||||
|
|
|
@ -48,11 +48,16 @@ defmodule Ash.Engine.Runner do
|
|||
"Synchronous engine starting - #{Enum.map_join(requests, ", ", & &1.name)}"
|
||||
end)
|
||||
|
||||
try do
|
||||
new_state = run_to_completion(state)
|
||||
|
||||
new_state.requests
|
||||
|> Enum.reduce(new_state, &add_data(&2, &1.path, &1.data))
|
||||
|> Map.put(:resource_notifications, new_state.resource_notifications)
|
||||
after
|
||||
Process.demonitor(state.engine_monitor_ref, [:flush])
|
||||
flush(state)
|
||||
end
|
||||
end
|
||||
|
||||
def run_to_completion(state) do
|
||||
|
@ -292,10 +297,7 @@ defmodule Ash.Engine.Runner do
|
|||
end
|
||||
|
||||
defp add_engine_state(state, engine_state) do
|
||||
new_state = %{state | errors: engine_state.errors ++ state.errors}
|
||||
|
||||
Process.demonitor(state.engine_monitor_ref, [:flush])
|
||||
flush(new_state)
|
||||
%{state | errors: engine_state.errors ++ state.errors}
|
||||
end
|
||||
|
||||
defp build_dependencies(request, dependencies) do
|
||||
|
|
|
@ -55,8 +55,6 @@ defmodule Ash.Page.Keyset do
|
|||
else
|
||||
sort_fields =
|
||||
sort
|
||||
# |> Enum.map(fn {key, val} when is_atom(key) ->
|
||||
# end)
|
||||
|> Keyword.keys()
|
||||
|> Enum.sort()
|
||||
|
||||
|
|
Loading…
Reference in a new issue