瀏覽代碼

fix: revert enable site if enable a incorrect config #199

0xJacky 1 年之前
父節點
當前提交
9a4174e6ef
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      server/api/domain.go

+ 1 - 0
server/api/domain.go

@@ -324,6 +324,7 @@ func EnableDomain(c *gin.Context) {
 	// Test nginx config, if not pass then disable the site.
 	output, err := nginx.TestConf()
 	if err != nil {
+		_ = os.Remove(enabledConfigFilePath)
 		ErrHandler(c, err)
 		return
 	}