couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couch commit: updated refs/heads/master to c68dc65
Date Tue, 22 Jul 2014 18:19:35 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/master 8675de9fc -> c68dc6511


Restore uniqueness of timestamps

Robert Newson is not to be trusted.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/c68dc651
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/c68dc651
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/c68dc651

Branch: refs/heads/master
Commit: c68dc6511d034f1dbfd889e133325f6faaf669b6
Parents: 8675de9
Author: Robert Newson <rnewson@apache.org>
Authored: Tue Jul 22 19:18:50 2014 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Jul 22 19:18:50 2014 +0100

----------------------------------------------------------------------
 src/couch_auth_cache.erl | 4 ++--
 src/couch_lru.erl        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/c68dc651/src/couch_auth_cache.erl
----------------------------------------------------------------------
diff --git a/src/couch_auth_cache.erl b/src/couch_auth_cache.erl
index c863ca1..4f6c308 100644
--- a/src/couch_auth_cache.erl
+++ b/src/couch_auth_cache.erl
@@ -186,7 +186,7 @@ handle_call({fetch, UserName}, _From, State) ->
     [] ->
         couch_stats_collector:increment({couchdb, auth_cache_misses}),
         Creds = get_user_props_from_db(UserName),
-        State1 = add_cache_entry(UserName, Creds, os:timestamp(), State),
+        State1 = add_cache_entry(UserName, Creds, erlang:now(), State),
         {Creds, State1}
     end,
     {reply, Credentials, NewState};
@@ -280,7 +280,7 @@ free_mru_cache_entry() ->
 
 
 cache_hit(UserName, Credentials, ATime) ->
-    NewATime = os:timestamp(),
+    NewATime = erlang:now(),
     true = ets:delete(?BY_ATIME, ATime),
     true = ets:insert(?BY_ATIME, {NewATime, UserName}),
     true = ets:insert(?BY_USER, {UserName, {Credentials, NewATime}}).

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/c68dc651/src/couch_lru.erl
----------------------------------------------------------------------
diff --git a/src/couch_lru.erl b/src/couch_lru.erl
index 7742055..97f27f8 100644
--- a/src/couch_lru.erl
+++ b/src/couch_lru.erl
@@ -19,13 +19,13 @@ new() ->
     {gb_trees:empty(), dict:new()}.
 
 insert(DbName, {Tree0, Dict0}) ->
-    Lru = os:timestamp(),
+    Lru = erlang:now(),
     {gb_trees:insert(Lru, DbName, Tree0), dict:store(DbName, Lru, Dict0)}.
 
 update(DbName, {Tree0, Dict0}) ->
     case dict:find(DbName, Dict0) of
     {ok, Old} ->
-        New = os:timestamp(),
+        New = erlang:now(),
         Tree = gb_trees:insert(New, DbName, gb_trees:delete(Old, Tree0)),
         Dict = dict:store(DbName, New, Dict0),
         {Tree, Dict};


Mime
View raw message