Skip to content

Commit

Permalink
credo
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulJKim committed Nov 8, 2023
1 parent 38802d6 commit b917e01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions lib/screenplay/config/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ defmodule Screenplay.Config.PermanentConfig do
end

defp get_current_config(etag) do
with {:ok, config, current_etag} <- S3Fetch.get_screens_config() do
if etag == current_etag,
do: {:ok, config},
else: :error
else
_ -> :error
case S3Fetch.get_screens_config() do
{:ok, config, current_etag} ->
if etag == current_etag,
do: {:ok, config},
else: :error

_ ->
:error
end
end
end
2 changes: 1 addition & 1 deletion lib/screenplay/config/s3_fetch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule Screenplay.Config.S3Fetch do
end
end

def get_screens_config() do
def get_screens_config do
with {:ok, screens_contents, etag} <- do_get(:screens),
{:ok, screens_json} <- Jason.decode(screens_contents) do
{:ok, screens_json, etag}
Expand Down

0 comments on commit b917e01

Please sign in to comment.