File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
core/src/main/java/com/flowci/core/common/service Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,21 @@ public class SettingServiceImpl implements SettingService {
3535 public void setDefaultValue () {
3636 taskManager .run ("init-default-settings" , () -> {
3737 Optional <Settings > optional = settingsDao .findById (Settings .DefaultId );
38- if (!optional .isPresent ()) {
3938
40- String address = serverProperties .getAddress ().toString ().replace ("/" , "" );
41- String serverUrl = environment .getProperty (
42- Variables .App .ServerUrl ,
43- String .format ("http://%s:%s" , address , serverProperties .getPort ())
44- );
39+ String address = serverProperties .getAddress ().toString ().replace ("/" , "" );
40+ String serverUrl = environment .getProperty (
41+ Variables .App .ServerUrl ,
42+ String .format ("http://%s:%s" , address , serverProperties .getPort ())
43+ );
4544
46- Settings s = new Settings ();
47- s .setServerUrl (serverUrl );
48- settingsDao .save (s );
45+ Settings s = new Settings ();
46+
47+ if (optional .isPresent ()) {
48+ s = optional .get ();
4949 }
50+
51+ s .setServerUrl (serverUrl );
52+ settingsDao .save (s );
5053 });
5154 }
5255
You can’t perform that action at this time.
0 commit comments