Changeset 321
- Timestamp:
- 05/05/08 03:21:47 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/picolena/templates/app/models/indexer.rb
r319 r321 39 39 indexing_list_chunks.each_with_thread{|chunk| 40 40 chunk.each{|complete_path| 41 last_itime=index_time_dbm_file[complete_path] 42 if @from_scratch || !last_itime || File.mtime(complete_path)> Time._load(last_itime) then 41 if should_index_this_document?(complete_path) then 43 42 add_or_update_file(complete_path) 44 43 else … … 109 108 Time._load(index_time_dbm_file['last']) rescue "none" 110 109 end 110 111 # For a given document, it retrieves the time it was last indexed, compare it to 112 # its modification time and returns false unless the file has been 113 # modified after the last indexing process. 114 def should_index_this_document?(complete_path) 115 last_itime=index_time_dbm_file[complete_path] 116 @from_scratch || !last_itime || File.mtime(complete_path)> Time._load(last_itime) 117 end 111 118 112 119 private
