mirror of
https://github.com/mitchell/shortnr.git
synced 2025-12-19 14:07:22 +00:00
Refactor dets repo, dockerfile, and url type; add logger level func
This commit is contained in:
parent
faaf12ba42
commit
fe413d2a5e
5 changed files with 19 additions and 6 deletions
|
|
@ -3,7 +3,10 @@ defmodule Shortnr.URL.Repo.DETS do
|
|||
|
||||
@impl true
|
||||
def get(key) do
|
||||
{:ok, :dets.lookup(:urls, key) |> List.first() |> elem(1)}
|
||||
case :dets.lookup(:urls, key) |> List.first() do
|
||||
{_, url} -> {:ok, url}
|
||||
nil -> {:ok, nil}
|
||||
end
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue