mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2026-03-13 09:02:05 +08:00
Starting Flyway No More Repeatedly
This commit is contained in:
@@ -35,7 +35,7 @@ public class Application {
|
||||
String currentVersion = ConfigUtils.getLocalVersion();
|
||||
ConfigJson configJson = ConfigUtils.getConfig();
|
||||
// Represents that the current version has been successfully launched
|
||||
if (StringUtils.equals(currentVersion, configJson.getLatestStartupSuccessVersion())) {
|
||||
if (StringUtils.isNotBlank(currentVersion) && StringUtils.equals(currentVersion, configJson.getLatestStartupSuccessVersion())) {
|
||||
// Flyway doesn't need to start every time to increase startup speed
|
||||
args = ArrayUtils.add(args, "--spring.flyway.enabled=false");
|
||||
log.info("The current version {} has been successfully launched once and will no longer load Flyway.",
|
||||
|
||||
@@ -23,7 +23,8 @@ public class AsyncContextRefreshedListener implements ApplicationListener<Contex
|
||||
// Successfully set up startup
|
||||
String currentVersion = ConfigUtils.getLocalVersion();
|
||||
ConfigJson configJson = ConfigUtils.getConfig();
|
||||
if (!StringUtils.equals(currentVersion, configJson.getLatestStartupSuccessVersion())) {
|
||||
if (StringUtils.isNotBlank(currentVersion) && !StringUtils.equals(currentVersion,
|
||||
configJson.getLatestStartupSuccessVersion())) {
|
||||
configJson.setLatestStartupSuccessVersion(currentVersion);
|
||||
ConfigUtils.setConfig(configJson);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user