History

Make docs mtime the greatest of the index and db files' mtime

Thibaut committed 11 years ago

Commit bc5488f1 parent ca7ff602 files · +13 −5Browse files

Showing the changes to lib/docs (1 of 2 files). Show all

Unified · Split

lib/docs/core/manifest.rb+5−1
@@ -15,7 +15,7 @@ module Docs · 14 unmodified lines
1515
1616 def as_json
1717 indexed_docs.map(&:as_json).each do |json|
18− json[:mtime] = @store.mtime(json[:index_path]).to_i
18+ json[:mtime] = doc_mtime(json)
1919 end
2020 end
2121
@@ -30,5 +30,9 @@ module Docs · 8 unmodified lines
3030 @store.exist?(doc.index_path) && @store.exist?(doc.db_path)
3131 end
3232 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
3337 end
3438 end