summaryrefslogtreecommitdiff
path: root/src/couch/src/couch_auth_cache.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couch/src/couch_auth_cache.erl')
-rw-r--r--src/couch/src/couch_auth_cache.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/couch/src/couch_auth_cache.erl b/src/couch/src/couch_auth_cache.erl
index 16c59d19a..45b34e1bd 100644
--- a/src/couch/src/couch_auth_cache.erl
+++ b/src/couch/src/couch_auth_cache.erl
@@ -203,7 +203,8 @@ handle_call({fetch, UserName}, _From, State) ->
[] ->
couch_stats:increment_counter([couchdb, auth_cache_misses]),
Creds = get_user_props_from_db(UserName),
- State1 = add_cache_entry(UserName, Creds, erlang:now(), State),
+ ATime = couch_util:unique_monotonic_integer(),
+ State1 = add_cache_entry(UserName, Creds, ATime, State),
{Creds, State1}
end,
{reply, Credentials, NewState};
@@ -311,7 +312,7 @@ free_mru_cache_entry() ->
cache_hit(UserName, Credentials, ATime) ->
- NewATime = erlang:now(),
+ NewATime = couch_util:unique_monotonic_integer(),
true = ets:delete(?BY_ATIME, ATime),
true = ets:insert(?BY_ATIME, {NewATime, UserName}),
true = ets:insert(?BY_USER, {UserName, {Credentials, NewATime}}).