fix: abort only when log level higher than warn

This commit is contained in:
0xJacky 2023-05-22 19:02:09 +08:00
parent e38380aac0
commit 509d059ceb
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
3 changed files with 402 additions and 402 deletions

View file

@ -1 +1 @@
{"version":"1.9.9","build_id":133,"total_build":203}
{"version":"1.9.9","build_id":134,"total_build":204}

View file

@ -1 +1 @@
{"version":"1.9.9","build_id":133,"total_build":203}
{"version":"1.9.9","build_id":134,"total_build":204}

View file

@ -316,7 +316,7 @@ func EnableDomain(c *gin.Context) {
// Test nginx config, if not pass then disable the site.
output := nginx.TestConf()
if nginx.GetLogLevel(output) >= nginx.Warn {
if nginx.GetLogLevel(output) > nginx.Warn {
_ = os.Remove(enabledConfigFilePath)
c.JSON(http.StatusInternalServerError, gin.H{
"message": output,
@ -326,7 +326,7 @@ func EnableDomain(c *gin.Context) {
output = nginx.Reload()
if nginx.GetLogLevel(output) >= nginx.Warn {
if nginx.GetLogLevel(output) > nginx.Warn {
c.JSON(http.StatusInternalServerError, gin.H{
"message": output,
})
@ -365,7 +365,7 @@ func DisableDomain(c *gin.Context) {
output := nginx.Reload()
if nginx.GetLogLevel(output) >= nginx.Warn {
if nginx.GetLogLevel(output) > nginx.Warn {
c.JSON(http.StatusInternalServerError, gin.H{
"message": output,
})