hi elixir community
I am working to create runtime databases for each user parallel via async tasks, for example, user1, user2, etc
1..count |> Task.async_stream(fn counter -> GenServer.call(String.to_atom("user#{counter}_db_worker"), {:create_dbs, counter}) end, [max_concurrency: 3, timeout: 30_000]) |> Enum.each(fn x -> IO.puts "Batch #{x} done" end)
but When I run the code with max_concurrency: 1
databases and migration are created so it must be a problem with the parallel processing.
any help thanks in advance.
this leads to the following error:
** (CompileError) _build/dev/lib/manager_with_sql/priv/repo/migrations/20220129033040_create_user.exs:1: cannot define module ManagerWithSql.Repo.Migrations.CreateUser because it is currently being defined in _build/dev/lib/manager_with_sql/priv/repo/migrations/20220129033040_create_user.exs:1