Skip to content

Commit

Permalink
fix: verify if task was concurrently deleted (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyeshe committed Jun 29, 2022
1 parent f62033c commit 17e7be7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ae_mdw/sync/async_tasks/store.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ defmodule AeMdw.Sync.AsyncTasks.Store do
defp fetch_all() do
Model.AsyncTask
|> Database.all_keys()
|> Enum.map(&Database.fetch!(Model.AsyncTask, &1))
|> Enum.flat_map(fn key ->
case Database.fetch(Model.AsyncTask, key) do
{:ok, m_task} -> [m_task]
:not_found -> []
end
end)
end

defp cache_tasks_by_args() do
Expand Down

0 comments on commit 17e7be7

Please sign in to comment.