You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when you incr on expired value it increases and returns expired value and doesn't invalidate it. I personally expected that it would increase the default value, if ttl is expired.
test"incr initializes default value if ttl is expired",%{cache: cache}doassertcache.incr(:another_counter_with_ttl,1,ttl: 1000)==1assertcache.incr(:another_counter_with_ttl)==2:ok=Process.sleep(1010)assertcache.incr(:another_counter_with_ttl,1,ttl: 1000)==1end
And here is the test ouput
1)testentry: incrinitializesdefaultvalueifttlisexpired(Nebulex.Adapters.LocalEtsTest)test/nebulex/adapters/local_ets_test.exs:94Assertion with ==failedcode: assertcache.incr(:another_counter_with_ttl,1,ttl: 1000)==1left: 3right: 1stacktrace:
test/nebulex/adapters/local_ets_test.exs:99: (test).....................................................................................................................2)testentry: incrinitializesdefaultvalueifttlisexpired(Nebulex.Adapters.LocalWithShardsTest)test/nebulex/adapters/local_shards_test.exs:94Assertion with ==failedcode: assertcache.incr(:another_counter_with_ttl,1,ttl: 1000)==1left: 3right: 1stacktrace:
test/nebulex/adapters/local_shards_test.exs:99: (test)
The text was updated successfully, but these errors were encountered:
Hey! Good catch! I pushed a fix already, please try it out. I will close the issue and publish a new release but feel free to re-open it if you find an issue with the fix. Thanks!
Hey!
Currently when you
incr
on expired value it increases and returns expired value and doesn't invalidate it. I personally expected that it would increase the default value, if ttl is expired.Here is an example test khaskelberg@49438f8
And here is the test ouput
The text was updated successfully, but these errors were encountered: