   def register_all_jobs() do
     FeedSource
     |> Repo.all()
-    |> Enum.map(&register_job/1)
+    |> Enum.map(&(spawn(Aggit.FetchJob, :register_job, [&1])))
   end
 
   @doc """

  @doc """
  Process feed and create new entries, see fetch_feed/1.
  """
  defp process_feed(feed_source, body) do
    case FeederEx.parse(body) do
      {:ok, feed, _} ->
        # Update feed source record.
        feed_map = Map.put(Map.from_struct(feed), :last_retrieved, Ecto.DateTime.utc())
        feed_source_changeset = FeedSource.changeset(feed_source, feed_map)
        case Repo.update(feed_source_changeset) do
          {:ok, _feed_source} ->
            # Insert any new feed entry records.
            Enum.map(feed.entries, fn(entry) ->
              feed_entry_changeset = FeedEntry.changeset(%FeedEntry{}, Map.from_struct(entry))
              Repo.insert_or_update(feed_entry_changeset)
              end
            )
          _ -> Logger.error("Unable to update FeedSource with id #{Integer.to_string(feed_source.id)}")
        end
      _ -> Logger.error("Unable to parse feed data from #{feed_source.feed_url} [#{Integer.to_string(feed_source.id)}]")
    end
  end

  @doc """

  Implements GenServer callback.
  """
  def start_link do
    GenServer.start_link(__MODULE__, %{})
  end

