           reviewer: reviewer})
           |> Repo.insert!()
     if is_new_batch do
-      put_incomplete_on_hold(get_repo_conn(project), batch)
+      put_incomplete_on_hold(repo_conn, batch)
     end
     poll_after_delay(project)
     # Maybe not needed because bors adds a commit referencing this.

    Process.send_after(self(), {:prerun_poll, @prerun_poll_period, args}, 0)
  end

  defp run(reviewer, patch, project, project_id, repo_conn) do
    {batch, is_new_batch} = get_new_batch(
      project_id,
      patch.into_branch,
      patch.priority
    )


  def handle_info({:prerun_poll, timeout, args}, proj_id) do
    IO.puts("Prerun polling #{timeout} #{timeout > @prerun_timeout}")
    {reviewer, patch} = args
    project = Repo.get(Project, patch.project_id)
    repo_conn = get_repo_conn(project)
    case patch_preflight(repo_conn, patch) do
      :ok ->
	IO.puts("Done waiting. Now building...")
	run(reviewer, patch)
      :waiting when timeout > @prerun_timeout ->
	IO.puts("Prerun timeout")
	send_message(repo_conn, [patch], {:preflight, :timeout})
