⚡️ Don’t save configuration for every Sone
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index 2ff27c9..be4ce4e 100644 (file)
@@ -120,6 +120,8 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
        /** The start time. */
        private final long startupTime = System.currentTimeMillis();
 
+       private final DebugInformation debugInformation = new DebugInformation();
+
        /** The preferences. */
        private final Preferences preferences;
 
@@ -227,6 +229,11 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                return startupTime;
        }
 
+       @Nonnull
+       public DebugInformation getDebugInformation() {
+               return debugInformation;
+       }
+
        /**
         * Returns the options used by the core.
         *
@@ -1500,8 +1507,6 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                        configuration.getStringValue(sonePrefix + "/Options/ShowCustomAvatars").setValue(sone.getOptions().getShowCustomAvatars().name());
                        configuration.getStringValue(sonePrefix + "/Options/LoadLinkedImages").setValue(sone.getOptions().getLoadLinkedImages().name());
 
-                       configuration.save();
-
                        webOfTrustUpdater.setProperty((OwnIdentity) sone.getIdentity(), "Sone.LatestEdition", String.valueOf(sone.getLatestEdition()));
 
                        logger.log(Level.INFO, String.format("Sone %s saved.", sone));