You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/01/13 19:21:04 UTC

[GitHub] [couchdb] nickva commented on a change in pull request #2445: Eliminate multiple compiler warnings

nickva commented on a change in pull request #2445: Eliminate multiple compiler warnings
URL: https://github.com/apache/couchdb/pull/2445#discussion_r365981834
 
 

 ##########
 File path: src/dreyfus/src/dreyfus_index_updater.erl
 ##########
 @@ -80,7 +80,7 @@ load_docs(FDI, {I, IndexPid, Db, Proc, Total, LastCommitTime, ExcludeIdRevs}=Acc
         false -> update_or_delete_index(IndexPid, Db, DI, Proc)
     end,
     %% Force a commit every minute
-    case timer:now_diff(Now = now(), LastCommitTime) >= 60000000 of
+    case timer:now_diff(Now = erlang:timestamp(), LastCommitTime) >= 60000000 of
 
 Review comment:
   Just quick note that in general `erlang:timestamp/0` isn't always a 1-to-1 replacement , as `now/0` returns strictly monotonic timestamps. In this case however we are operating at minute level intervals and even if previous timestamp is greater than the current one, `timer:now_diff/2` will just return a negative value and eventually should catch up, instead of say crashing

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services