mirror of
https://github.com/valitydev/cache.git
synced 2024-11-06 01:45:19 +00:00
fix: cache bucket crash if memory limit is defined
This commit is contained in:
parent
ceebafa2ba
commit
b3382c75db
@ -1,7 +1,7 @@
|
||||
{application, cache,
|
||||
[
|
||||
{description, "in-memory cache"},
|
||||
{vsn, "0.9.0"},
|
||||
{vsn, "0.9.1"},
|
||||
{modules, [
|
||||
cache,
|
||||
cache_bucket,
|
||||
@ -16,4 +16,4 @@
|
||||
{mod, {cache_app, []}},
|
||||
{env, []}
|
||||
]
|
||||
}.
|
||||
}.
|
||||
|
@ -76,7 +76,7 @@ init([{policy, X} | T], #cache{}=S) ->
|
||||
init(T, S#cache{policy=X});
|
||||
|
||||
init([{memory, X} | Opts], S) ->
|
||||
init(Opts, S#cache{memory=X div erlang:sysinfo(wordsize)});
|
||||
init(Opts, S#cache{memory=X div erlang:system_info(wordsize)});
|
||||
|
||||
init([{size, X} | Opts], S) ->
|
||||
init(Opts, S#cache{cardinality=X});
|
||||
|
Loading…
Reference in New Issue
Block a user