This repository was archived by the owner on Aug 18, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
src/main/scala/org/codeoverflow/chatoverflow Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -112,15 +112,20 @@ class ChatOverflow(val pluginFolderPath: String,
112112 * Saves all settings and credentials to the corresponding files in the config folder.
113113 */
114114 def save (): Unit = {
115- val currentTime = System .currentTimeMillis()
115+ if (loaded) {
116+ val currentTime = System .currentTimeMillis()
116117
117- // Start by saving credentials
118- credentialsService.save()
118+ // Start by saving credentials
119+ credentialsService.save()
119120
120- // Save connectors and plugin instances (Note: Less work then loading)
121- configService.save(pluginInstanceRegistry)
121+ // Save connectors and plugin instances (Note: Less work then loading)
122+ configService.save(pluginInstanceRegistry)
122123
123- logger info s " Saving took ${System .currentTimeMillis() - currentTime} ms. "
124+ logger info s " Saving took ${System .currentTimeMillis() - currentTime} ms. "
125+ } else {
126+ // If the framework isn't loaded it would also override anything with defaults when saving
127+ logger info " Framework hasn't been loaded. Nothing has to be saved."
128+ }
124129 }
125130
126131}
You can’t perform that action at this time.
0 commit comments