iilyak commented on a change in pull request #539: Close idle dbs
URL: https://github.com/apache/couchdb/pull/539#discussion_r119700451
 
 

 ##########
 File path: src/couch/src/couch_file.erl
 ##########
 @@ -338,12 +339,33 @@ init_status_error(ReturnPid, Ref, Error) ->
     ReturnPid ! {Ref, self(), Error},
     ignore.
 
+last_read(Fd) when is_pid(Fd) ->
+    ReadTsSec = case process_info(Fd, dictionary) of
+        {dictionary, Dict} ->
+            case lists:keyfind(read_timestamp, 1, Dict) of
 
 Review comment:
   Something very similar is used in process_info. Would it make sense to 
create a function:
   ```
   get(Pid, Key, DefaultValue)
   ```
   We also could consider to create this kind of function in 
`couch_util:get_value_from_pid/3` if you think we are going to use this 
approach a lot.
 
----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to