   use Agent
   alias Osdi.{Repo, Tagging, Tag}
   import Ecto.Query
+  require Logger
 
   @in_last [hours: -1]
 

  def dump_state do
    state = Agent.get __MODULE__, fn state -> state end

    Enum.map state, fn {title, %{total: total, in_last: in_last}} ->
      "#{title}:\t#{total}"
    end
  end
end

          list -> Map.put(acc, petition_name, [tag_id | list])
        end
      end)
      |> Enum.map(fn {title, tag_ids} -> Task.async(fn -> update_petition({title, tag_ids}) end) end)

    Enum.each tasks, &Task.await/1

    Logger.info "Updated petition cache on #{Timex.now() |> DateTime.to_iso8601()}"
  end

  defp update_petition({title, tag_ids}) do
