summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHentioe <me@bluerain.io>2020-12-10 22:07:43 +0800
committerHentioe <me@bluerain.io>2020-12-10 22:07:43 +0800
commit4dbe70773b31f06f20c2c600d8c9d00b33624008 (patch)
treec2573955b3d0b72a78d23c0875cbf336804aa9c5 /lib
parentAdd run command related APIs (diff)
parentFix publish (diff)
Merge branch 'master' of github.com:Hentioe/azure_ex
Diffstat (limited to 'lib')
-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