@ -938,6 +938,7 @@ public class ArbitraryResource {
// Loop until we have data
// Loop until we have data
while ( ! Controller . isStopping ( ) ) {
while ( ! Controller . isStopping ( ) ) {
attempts + + ;
attempts + + ;
if ( ! arbitraryDataReader . isBuilding ( ) ) {
try {
try {
arbitraryDataReader . loadSynchronously ( rebuild ) ;
arbitraryDataReader . loadSynchronously ( rebuild ) ;
break ;
break ;
@ -946,10 +947,10 @@ public class ArbitraryResource {
// Give up after 5 attempts
// Give up after 5 attempts
throw ApiExceptionFactory . INSTANCE . createCustomException ( request , ApiError . INVALID_CRITERIA , "Data unavailable. Please try again later." ) ;
throw ApiExceptionFactory . INSTANCE . createCustomException ( request , ApiError . INVALID_CRITERIA , "Data unavailable. Please try again later." ) ;
}
}
Thread . sleep ( 3000L ) ;
}
}
}
}
Thread . sleep ( 3000L ) ;
}
java . nio . file . Path outputPath = arbitraryDataReader . getFilePath ( ) ;
java . nio . file . Path outputPath = arbitraryDataReader . getFilePath ( ) ;
if ( filepath = = null | | filepath . isEmpty ( ) ) {
if ( filepath = = null | | filepath . isEmpty ( ) ) {
@ -986,7 +987,9 @@ public class ArbitraryResource {
if ( build ! = null & & build = = true ) {
if ( build ! = null & & build = = true ) {
ArbitraryDataReader reader = new ArbitraryDataReader ( name , ArbitraryDataFile . ResourceIdType . NAME , service , null ) ;
ArbitraryDataReader reader = new ArbitraryDataReader ( name , ArbitraryDataFile . ResourceIdType . NAME , service , null ) ;
try {
try {
if ( ! reader . isBuilding ( ) ) {
reader . loadSynchronously ( false ) ;
reader . loadSynchronously ( false ) ;
}
} catch ( Exception e ) {
} catch ( Exception e ) {
// No need to handle exception, as it will be reflected in the status
// No need to handle exception, as it will be reflected in the status
}
}