mirror of https://github.com/apache/lucene.git
Use IndexCommit#getTimestamp added in Lucene 2.4
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@706893 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d76776eb1b
commit
0d8d200c20
|
@ -133,6 +133,10 @@ public class IndexDeletionPolicyWrapper implements IndexDeletionPolicy {
|
|||
public boolean isDeleted() {
|
||||
return delegate.isDeleted();
|
||||
}
|
||||
|
||||
public long getTimestamp() throws IOException {
|
||||
return delegate.getTimestamp();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -122,9 +122,8 @@ public class SolrDeletionPolicy implements IndexDeletionPolicy, NamedListInitial
|
|||
}
|
||||
|
||||
try {
|
||||
//TODO: replace LHS of if condition with commit.getTimestamp()
|
||||
if (maxCommitAge != null)
|
||||
if (commit.getDirectory().fileModified(commit.getSegmentsFileName()) < dmp.parseMath(maxCommitAge).getTime()) {
|
||||
if (commit.getTimestamp() < dmp.parseMath(maxCommitAge).getTime()) {
|
||||
commit.delete();
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue