Skip to content

cache_tab caching errors #4

@santiagopoli

Description

@santiagopoli

When I cache something which returns "error", the value is cached.

For example:

> cache_tab:new(cache_test, []).
> cache_tab:lookup(cache_test, key1, fun() -> error end).
> error
> cache_tab:lookup(cache_test, key1, fun() -> {ok, 1} end).
> error

I was expecting to get 1 as a value instead of error. It seems that cache_tab is caching the error as well. Maybe the documentation is wrong and I need to return something else.

Thanks!

PS: I'm using version 1.0.4 of cache_tab

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions