mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
delete corrupted collecion.index on exit for rebuild on next start
see http://forum.yacy-websuche.de/viewtopic.php?p=9725#p9725 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5135 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
b68d06a6e8
commit
0bb4fbc403
|
@ -67,6 +67,10 @@ public class indexCollectionRI implements indexRI {
|
|||
}
|
||||
}
|
||||
|
||||
public void deleteIndexOnExit() {
|
||||
collectionIndex.deleteIndexOnExit();
|
||||
}
|
||||
|
||||
public long getUpdateTime(final String wordHash) {
|
||||
final indexContainer entries = getContainer(wordHash, null);
|
||||
if (entries == null) return 0;
|
||||
|
|
|
@ -177,6 +177,11 @@ public class kelondroCollectionIndex {
|
|||
}
|
||||
}
|
||||
|
||||
public void deleteIndexOnExit() {
|
||||
// will be rebuilt on next start
|
||||
new File(this.path, this.filenameStub + ".index").deleteOnExit();
|
||||
}
|
||||
|
||||
private void openAllArrayFiles(final boolean indexGeneration, final kelondroByteOrder indexOrder) throws IOException {
|
||||
|
||||
final String[] list = this.path.list();
|
||||
|
|
|
@ -270,6 +270,7 @@ public class plasmaDHTChunk {
|
|||
indexContainers = new indexContainer[0];
|
||||
urlCache = new HashMap<String, indexURLReference>();
|
||||
this.status = chunkStatus_FAILED;
|
||||
wordIndex.deleteIndexOnExit(); // delete index on exit for rebuild
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -219,6 +219,10 @@ public final class plasmaWordIndex implements indexRI {
|
|||
queuePreStack.clear();
|
||||
}
|
||||
|
||||
public void deleteIndexOnExit() {
|
||||
collections.deleteIndexOnExit();
|
||||
}
|
||||
|
||||
private void initActiveCrawlProfiles() {
|
||||
this.defaultProxyProfile = null;
|
||||
this.defaultRemoteProfile = null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user