Include cache hit/miss info in return type
This can be useful downstream for diagnostics.
This commit is contained in:
parent
1a404a58de
commit
45877a8b9c
2 changed files with 4 additions and 3 deletions
|
|
@ -16,11 +16,11 @@ defmodule Server do
|
|||
|
||||
res ->
|
||||
Cache.put(n, res)
|
||||
res
|
||||
{:miss, res}
|
||||
end
|
||||
|
||||
hit ->
|
||||
hit
|
||||
{:hit, hit}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue