Преглед на файлове

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
 	}