internally mark if a server is restoring to restrict actions

This commit is contained in:
Matthew Penner
2021-03-12 16:19:35 -07:00
parent b63a491b5e
commit 471886dd34
5 changed files with 32 additions and 3 deletions

View File

@@ -70,6 +70,10 @@ func (s *Server) HandlePowerAction(action PowerAction, waitSeconds ...int) error
return ErrServerIsTransferring
}
if s.IsRestoring() {
return ErrServerIsRestoring
}
if s.powerLock == nil {
s.powerLock = semaphore.NewWeighted(1)
}