       crash: inspect(reason, pretty: true, width: 60)
     })
 
-    {:noreply, state}
+    {:noreply, {names, refs}}
   end
 
   def handle_info(_msg, state) do

    {:reply, pid, state}
  end

  def handle_info({:DOWN, ref, :process, _pid, :normal}, {names, refs}) do
    {project_id, refs} = Map.pop(refs, ref)
    names = Map.delete(names, project_id)
    {:noreply, {names, refs}}
  end

  def handle_info({:DOWN, ref, :process, _, reason}, {_, refs} = state) do
    project_id = refs[ref]
    {pid, state} = start_and_insert(project_id, state)
    Batcher.cancel_all(pid)

    Repo.insert(%Crash{
      project_id: project_id,

  use GenServer

  alias BorsNG.Worker.Batcher
  alias BorsNG.Database.Batch
  alias BorsNG.Database.Crash
  alias BorsNG.Database.Project
  alias BorsNG.Database.Repo
