From 6fa61d0d752390c3d131d66b293bb0fbd55def7a Mon Sep 17 00:00:00 2001 From: Hentioe Date: Sat, 5 Dec 2020 21:11:28 +0800 Subject: Fix credo issues --- lib/azure_ex/token_hosting.ex | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3