     Logger.info "Running DB cleaner..."
     clean_db()
     Logger.info "Scraping repos (trending + existing)..."
-    Repo.update_all(GithubRepo, set: [trending: false])
     rescrape()
     Logger.info "Periodic process finished successfully!"
     reschedule_work()

  end

  @doc """
  Instead of working on the repos directly, create changesets to manipulate.
  """
  def create_changesets() do
    existing = Stream.map(Repo.all(GithubRepo),
                          fn struct -> {struct, %{}} end)
    trending = Stream.map(Periodic.GithubTrending.scrape(),
                          fn params -> {%GithubRepo{}, params} end)
    all = Stream.concat(existing, trending)
    all
    |> Stream.map(
      fn {struct, params} -> GithubRepo.cast_allowed(struct, params) end
    )
    |> Stream.uniq(&fetch_name/1)
  end

  @doc """

  Rescrape existing repos plus new github trending repos.
  """
  def rescrape() do
    existing = Repo.all(GithubRepo)
    trending = Periodic.GithubTrending.scrape()
    new_trending = set_trendiness(existing, trending)
    existing = Repo.all(GithubRepo)  # Trendiness updated
    all = create_changesets(existing, new_trending)
    all
    |> Stream.map(&api_only_updates_and_redirects/1)
    |> Stream.map(&scrape_pulse_page/1)
    |> Stream.map(&GithubRepo.finalize_changeset/1)
