Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma] / lib / pleroma / uploaders / uploader.ex
index d71e213d28e7f1766507c86ad8b6758ab409a971..0be878ca282c0bf039b90a7395fd90bdb81e1d4c 100644 (file)
@@ -1,10 +1,12 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Uploaders.Uploader do
   import Pleroma.Web.Gettext
 
+  @mix_env Mix.env()
+
   @moduledoc """
   Defines the contract to put and get an uploaded file to any backend.
   """
@@ -12,7 +14,7 @@ defmodule Pleroma.Uploaders.Uploader do
   @doc """
   Instructs how to get the file from the backend.
 
-  Used by `Pleroma.Plugs.UploadedMedia`.
+  Used by `Pleroma.Web.Plugs.UploadedMedia`.
   """
   @type get_method :: {:static_dir, directory :: String.t()} | {:url, url :: String.t()}
   @callback get_file(file :: String.t()) :: {:ok, get_method()}
@@ -74,7 +76,7 @@ defmodule Pleroma.Uploaders.Uploader do
   end
 
   defp callback_timeout do
-    case Mix.env() do
+    case @mix_env do
       :test -> 1_000
       _ -> 30_000
     end