mirror of
https://github.com/Qortal/qortal.git
synced 2025-04-24 03:47:52 +00:00
added some critical exception handling for arbitrary data indexing support
This commit is contained in:
parent
ab4730cef0
commit
dbf49309ec
@ -2,6 +2,7 @@ package org.qortal.utils;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@ -95,6 +96,7 @@ public class ArbitraryIndexUtils {
|
|||||||
// process all index resources
|
// process all index resources
|
||||||
for( ArbitraryResourceData indexResource : indexResources ) {
|
for( ArbitraryResourceData indexResource : indexResources ) {
|
||||||
|
|
||||||
|
try {
|
||||||
LOGGER.debug("processing index resource: name = " + indexResource.name + ", identifier = " + indexResource.identifier);
|
LOGGER.debug("processing index resource: name = " + indexResource.name + ", identifier = " + indexResource.identifier);
|
||||||
String json = ArbitraryIndexUtils.getJson(indexResource.name, indexResource.identifier);
|
String json = ArbitraryIndexUtils.getJson(indexResource.name, indexResource.identifier);
|
||||||
|
|
||||||
@ -108,6 +110,9 @@ public class ArbitraryIndexUtils {
|
|||||||
|
|
||||||
indexDetails.add( new ArbitraryDataIndexDetail(indexResource.name, rank, indices.get(rank - 1) ));
|
indexDetails.add( new ArbitraryDataIndexDetail(indexResource.name, rank, indices.get(rank - 1) ));
|
||||||
}
|
}
|
||||||
|
} catch (InvalidFormatException e) {
|
||||||
|
LOGGER.warn("invalid format, skipping: " + indexResource);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("processing indices by term ...");
|
LOGGER.debug("processing indices by term ...");
|
||||||
@ -123,7 +128,7 @@ public class ArbitraryIndexUtils {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
LOGGER.info("processed indices by term = " + indicesByTerm);
|
LOGGER.info("processed indices by term: count = " + indicesByTerm.size());
|
||||||
|
|
||||||
// lock, clear old, load new
|
// lock, clear old, load new
|
||||||
synchronized( IndexCache.getInstance().getIndicesByTerm() ) {
|
synchronized( IndexCache.getInstance().getIndicesByTerm() ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user