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:
[email protected]


With regards,
Apache Git Services

Reply via email to