From 8f6ff8c943c2c23957dbb516f3c3d23a2584822f Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 4 Mar 2024 20:56:48 -0600 Subject: [PATCH] Fix data sources not saving correctly --- .../file/AbstractNewDataSourceHandler.java | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java index 99eb57815..db3c2c783 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java @@ -214,27 +214,18 @@ public abstract class AbstractNewDataSourceHandler if (dataModified) { - ThreadPoolExecutor executor = ThreadPoolUtil.getFileHandlerExecutor(); - if (executor == null || executor.isTerminated()) - { - return; - } + // save the updated data to the database + TDTO dto = this.createDtoFromDataSource(dataSource); + this.repo.save(dto); - executor.execute(() -> + + for (IDataSourceUpdateFunc listener : this.dateSourceUpdateListeners) { - // save the updated data to the database - TDTO dto = this.createDtoFromDataSource(dataSource); - this.repo.save(dto); - - - for (IDataSourceUpdateFunc listener : this.dateSourceUpdateListeners) + if (listener != null) { - if (listener != null) - { - listener.OnDataSourceUpdated(dataSource); - } + listener.OnDataSourceUpdated(dataSource); } - }); + } } } catch (Exception e)