mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-06 13:22:11 +08:00
fix bug: component check
This commit is contained in:
parent
9729e69bbf
commit
073545e282
@ -1,4 +1,4 @@
|
||||
\Users\17191\GolandProjects\awesomeProject>#!/usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
@ -14,6 +14,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# shellcheck disable=SC2034 # Variables sourced in other scripts.
|
||||
|
||||
# Common utilities, variables and checks for all build scripts.
|
||||
|
||||
@ -103,37 +103,29 @@ func main() {
|
||||
err = check.function(check.config)
|
||||
if err != nil {
|
||||
if check.name == "Minio" {
|
||||
if errors.Is(err, errMinioNotEnabled) {
|
||||
fmt.Println(err.Error(), " check ", check.name)
|
||||
checks[index].flag = true
|
||||
}
|
||||
if errors.Is(err, errSignEndPoint) {
|
||||
if errors.Is(err, errMinioNotEnabled) ||
|
||||
errors.Is(err, errSignEndPoint) ||
|
||||
errors.Is(err, errApiURL) {
|
||||
fmt.Fprintf(os.Stderr, err.Error(), " check ", check.name)
|
||||
checks[index].flag = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error()))
|
||||
if strings.Contains(errs.Unwrap(err).Error(), "connection refused") ||
|
||||
strings.Contains(errs.Unwrap(err).Error(), "timeout") ||
|
||||
strings.Contains(errs.Unwrap(err).Error(), "context deadline exceeded") {
|
||||
component.ErrorPrint(fmt.Sprintf("try check connection %s", check.name))
|
||||
allSuccess = false
|
||||
component.ErrorPrint(fmt.Sprintf("Check component: %s failed:%v.", check.name, errs.Error()))
|
||||
break
|
||||
}
|
||||
} else {
|
||||
checks[index].flag = true
|
||||
component.SuccessPrint(fmt.Sprintf("%s connected successfully", check.name))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if allSuccess {
|
||||
component.SuccessPrint("All components started successfully!")
|
||||
return
|
||||
}
|
||||
}
|
||||
component.ErrorPrint("Some components started failed!")
|
||||
component.ErrorPrint("Some components checked failed!")
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user