mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +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 go to a specific page number
|
||||||
- Can't use aggregate and calculation sorting
|
- Can't use aggregate and calculation sorting
|
||||||
|
|
||||||
|
|
||||||
For more information on keyset vs offset based pagination, see:
|
For more information on keyset vs offset based pagination, see:
|
||||||
|
|
||||||
- [Offset vs Seek Pagination](https://taylorbrazelton.com/posts/2019/03/offset-vs-seek-pagination/)
|
- [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)}"
|
"Synchronous engine starting - #{Enum.map_join(requests, ", ", & &1.name)}"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
new_state = run_to_completion(state)
|
try do
|
||||||
|
new_state = run_to_completion(state)
|
||||||
|
|
||||||
new_state.requests
|
new_state.requests
|
||||||
|> Enum.reduce(new_state, &add_data(&2, &1.path, &1.data))
|
|> Enum.reduce(new_state, &add_data(&2, &1.path, &1.data))
|
||||||
|> Map.put(:resource_notifications, new_state.resource_notifications)
|
|> Map.put(:resource_notifications, new_state.resource_notifications)
|
||||||
|
after
|
||||||
|
Process.demonitor(state.engine_monitor_ref, [:flush])
|
||||||
|
flush(state)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_to_completion(state) do
|
def run_to_completion(state) do
|
||||||
|
@ -292,10 +297,7 @@ defmodule Ash.Engine.Runner do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp add_engine_state(state, engine_state) do
|
defp add_engine_state(state, engine_state) do
|
||||||
new_state = %{state | errors: engine_state.errors ++ state.errors}
|
%{state | errors: engine_state.errors ++ state.errors}
|
||||||
|
|
||||||
Process.demonitor(state.engine_monitor_ref, [:flush])
|
|
||||||
flush(new_state)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp build_dependencies(request, dependencies) do
|
defp build_dependencies(request, dependencies) do
|
||||||
|
|
|
@ -55,8 +55,6 @@ defmodule Ash.Page.Keyset do
|
||||||
else
|
else
|
||||||
sort_fields =
|
sort_fields =
|
||||||
sort
|
sort
|
||||||
# |> Enum.map(fn {key, val} when is_atom(key) ->
|
|
||||||
# end)
|
|
||||||
|> Keyword.keys()
|
|> Keyword.keys()
|
||||||
|> Enum.sort()
|
|> Enum.sort()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue