SOLR-1126 -- Replicated files have incorrect timestamp

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@768180 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-04-24 06:42:30 +00:00
parent 33bcabc9f6
commit 354f780613
2 changed files with 6 additions and 1 deletions

View File

@ -338,6 +338,8 @@ Bug Fixes
37. SOLR-1125: Use query analyzer rather than index analyzer for queryFieldType in QueryElevationComponent
(koji)
38. SOLR-1126: Replicated files have incorrect timestamp (Jian Han Guo, Jeff Newburn, Noble Paul via shalin)
Other Changes
----------------------
1. Upgraded to Lucene 2.4.0 (yonik)

View File

@ -787,6 +787,9 @@ public class SnapPuller {
this.size = (Long) fileDetails.get(SIZE);
this.isConf = isConf;
this.saveAs = saveAs;
if(fileDetails.get(LAST_MODIFIED) != null){
lastmodified = (Long)fileDetails.get(LAST_MODIFIED);
}
indexVersion = latestVersion;
this.file = new File(snapDir, saveAs);
@ -809,7 +812,7 @@ public class SnapPuller {
if (result == 0 || result == NO_CONTENT) {
// if the file is downloaded properly set the
// timestamp same as that in the server
if (file.exists())
if (file.exists() && lastmodified > 0)
file.setLastModified(lastmodified);
return;
}