summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHentioe <me@bluerain.io>2020-12-05 21:11:28 +0800
committerHentioe <me@bluerain.io>2020-12-05 21:11:28 +0800
commit6fa61d0d752390c3d131d66b293bb0fbd55def7a (patch)
treeda9bf0cfc2cf840dc694b23f05da527e1de731a9
parentAutomatic retry of token application failure (diff)
Fix credo issues
-rw-r--r--lib/azure_ex/token_hosting.ex18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/azure_ex/token_hosting.ex b/lib/azure_ex/token_hosting.ex
index e659fd5..6c0a4c8 100644
--- a/lib/azure_ex/token_hosting.ex
+++ b/lib/azure_ex/token_hosting.ex
@@ -1,14 +1,14 @@
defmodule AzureEx.TokenHosting do
@moduledoc false
- # TODO: 轮询检查令牌有效性。
-
use GenServer
require Logger
defmodule Token do
- @moduledoc false
+ @moduledoc """
+ Azure API token.
+ """
defstruct [:access_token, :expires_in, :created_at]
@@ -26,7 +26,9 @@ defmodule AzureEx.TokenHosting do
end
defmodule Params do
- @moduledoc false
+ @moduledoc """
+ Parameters for applying token.
+ """
defstruct [:tenant, :client_id, :client_secret]
@@ -75,12 +77,8 @@ defmodule AzureEx.TokenHosting do
apply_token(params)
- {:error, e} ->
- # TODO: 抽象出错误模型
- Logger.error("Token application failed, details: #{inspect(e)}")
- :timer.sleep(500)
-
- apply_token(params)
+ e ->
+ e
end
end