summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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