Showing the changes to lib/docs (1 of 3 files). Show all
Unified · Split
| @@ -16,6 +16,7 @@ module Docs · 15 unmodified lines | |||
| 16 | def as_json | 16 | def as_json |
| 17 | indexed_docs.map(&:as_json).each do |json| | 17 | indexed_docs.map(&:as_json).each do |json| |
| 18 | json[:mtime] = doc_mtime(json) | 18 | json[:mtime] = doc_mtime(json) |
| 19 | json[:db_size] = doc_db_size(json) | ||
| 19 | end | 20 | end |
| 20 | end | 21 | end |
| 21 | 22 | ||
| @@ -34,5 +35,9 @@ module Docs · 12 unmodified lines | |||
| 34 | def doc_mtime(doc) | 35 | def doc_mtime(doc) |
| 35 | [@store.mtime(doc[:index_path]).to_i, @store.mtime(doc[:db_path]).to_i].max | 36 | [@store.mtime(doc[:index_path]).to_i, @store.mtime(doc[:db_path]).to_i].max |
| 36 | end | 37 | end |
| 38 | |||
| 39 | def doc_db_size(doc) | ||
| 40 | @store.size(doc[:db_path]) | ||
| 41 | end | ||
| 37 | end | 42 | end |
| 38 | end | 43 | end |