fix scheduler for geonames service
@@ -98,12 +98,12 @@ public class GeonamesServiceImpl implements GeonamesService {
}
final File f = new File(pathToGeonamesDatabase);
if (f.exists()) {
- schedulerService.getScheduleExecutorService().scheduleWithFixedDelay(new TimerTask() {
+ schedulerService.getScheduleExecutorService().schedule(new TimerTask() {
@Override
public void run() {
importGeoNameDatabase(f);
}
- }, 0, refreshDbInterval, TimeUnit.MILLISECONDS);
+ }, refreshDbInterval, TimeUnit.MILLISECONDS);
}
}
@@ -111,12 +111,12 @@ public class GeonamesServiceImpl implements GeonamesService {
Map<String,Map<String,Object>> typeMappings = persistenceService.getPropertiesMapping(GeonameEntry.ITEM_TYPE);
if (typeMappings == null || typeMappings.size() == 0) {
logger.warn("Type mappings for type {} are not yet installed, delaying import until they are ready!", GeonameEntry.ITEM_TYPE);
- schedulerService.getScheduleExecutorService().scheduleWithFixedDelay(new TimerTask() {
+ schedulerService.getScheduleExecutorService().schedule(new TimerTask() {
@Override
public void run() {
importGeoNameDatabase(f);
}
- }, 0, refreshDbInterval, TimeUnit.MILLISECONDS);
+ }, refreshDbInterval, TimeUnit.MILLISECONDS);
return;
} else {
// let's check that the mappings are correct
