     end)
   end
 
-  @spec do_checkup :: no_return
-  defp do_checkup do
+  @spec do_checkup(Context.t) :: no_return
+  defp do_checkup(%Context{} = context) do
     images = File.ls!(@images_path)
 
     images
     |> Enum.all?(fn(file) ->
       path = Path.join(@images_path, file)
-      case try_upload(path) do
+      case try_upload(context, path) do
         {:ok, _} ->
           File.rm!(path)
           :ok

  @doc """
    Uploads all images if they exist.
  """
  @spec force_upload :: no_return
  def force_upload, do: do_checkup()

  def init(_context) do
    # TODO(Connor) kill :fs if this app dies.
    :fs_app.start(:normal, [])
    :fs.subscribe()
    {:ok, []}
  end

  @spec handle_info(any, state) :: {:noreply, state}
  def handle_info(:checkup, []) do
    do_checkup()
    {:noreply, []}
  end

  def handle_info({_pid, {:fs, :file_event}, {path, [:modified, :closed]}},
  _state) do
    if matches_any_pattern?(path, [~r{/tmp/images/.*(jpg|jpeg|png|gif)}]) do
      do_checkup()
    end
    {:noreply, []}
  end

  def handle_info(_, state), do: {:noreply, state}

    |> print_thing(Enum.count(images)) # Sorry
  end

  @spec try_upload(Context.t, binary) :: {:ok, any} | {:error, any}
  defp try_upload(%Context{} = ctx, file_path) do
    Logger.info "Image Watcher trying to upload #{file_path}"
    Farmbot.HTTP.upload_file(ctx, file_path)
  end

  @spec print_thing(boolean, integer) :: :ok
