Showing the changes to lib/docs (1 of 2 files). Show all
Unified · Split
| @@ -15,7 +15,7 @@ module Docs · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | def as_json |
| 17 | 17 | indexed_docs.map(&:as_json).each do |json| |
| 18 | − json[:mtime] = @store.mtime(json[:index_path]).to_i | |
| 18 | + json[:mtime] = doc_mtime(json) | |
| 19 | 19 | end |
| 20 | 20 | end |
| 21 | 21 | |
| @@ -30,5 +30,9 @@ module Docs · 8 unmodified lines | ||
| 30 | 30 | @store.exist?(doc.index_path) && @store.exist?(doc.db_path) |
| 31 | 31 | end |
| 32 | 32 | end |
| 33 | + | |
| 34 | + def doc_mtime(doc) | |
| 35 | + [@store.mtime(doc[:index_path]).to_i, @store.mtime(doc[:db_path]).to_i].max | |
| 36 | + end | |
| 33 | 37 | end |
| 34 | 38 | end |