iilyak commented on a change in pull request #2: Avoid using `erlang:now/0`
URL: https://github.com/apache/couchdb-smoosh/pull/2#discussion_r259806797
 
 

 ##########
 File path: src/smoosh_server.erl
 ##########
 @@ -265,8 +265,10 @@ find_channel(Tab, [Channel|Rest], Object) ->
     Pid = channel_pid(Tab, Channel),
     LastUpdated = smoosh_channel:last_updated(Pid, Object),
     Staleness = 6.0e7 * list_to_integer(config:get("smoosh", "staleness", 
"5")),
+    Now = erlang:monotonic_time(),
     case LastUpdated =:= false orelse
-        timer:now_diff(now(), LastUpdated) > Staleness of
+        erlang:convert_time_unit(
+            Now - LastUpdated, native, microsecond) > Staleness of
 
 Review comment:
   @jaydoane I updated the code.

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


With regards,
Apache Git Services

Reply via email to