Pārlūkot izejas kodu

fix(upgrader): add delay before graceful restart to ensure file write completion nginx ui #911

Jacky 1 dienu atpakaļ
vecāks
revīzija
faaaa247e6
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      internal/upgrader/upgrade.go

+ 4 - 0
internal/upgrader/upgrade.go

@@ -11,6 +11,7 @@ import (
 	"strconv"
 	"strings"
 	"sync/atomic"
+	"time"
 
 	"code.pfad.fr/risefront"
 	_github "github.com/0xJacky/Nginx-UI/.github"
@@ -273,6 +274,9 @@ func (u *Upgrader) PerformCoreUpgrade(tarPath string) (err error) {
 		return err
 	}
 
+	// wait for the file to be written
+	time.Sleep(1 * time.Second)
+
 	// gracefully restart
 	risefront.Restart()
 	return