mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 10:16:37 +08:00
[优化] 代码优化
This commit is contained in:
@@ -292,21 +292,6 @@ func DiffConfigVersion() (*ConfigDiffResult, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func HasConfigChanges() (bool, error) {
|
||||
bundle, err := buildCurrentConfigBundle(false)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
activeVersion, err := model.GetActiveConfigVersion()
|
||||
if err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return len(bundle.Routes) > 0, nil
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
return activeVersion.Checksum != bundle.Checksum, nil
|
||||
}
|
||||
|
||||
func PublishConfigVersion(createdBy string, force bool) (*ReleaseResult, error) {
|
||||
bundle, err := buildCurrentConfigBundle(true)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user