Add transfer logging output (#77)

Co-authored-by: Dane Everitt <dane@daneeveritt.com>
This commit is contained in:
Matthew Penner
2020-12-25 14:32:41 -07:00
committed by GitHub
parent 901ab1157d
commit 5c78cb9ab3
16 changed files with 398 additions and 227 deletions

View File

@@ -144,7 +144,8 @@ func (s *Server) acquireInstallationLock() error {
s.installer.sem = semaphore.NewWeighted(1)
}
ctx, _ := context.WithTimeout(context.Background(), time.Second*10)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
return s.installer.sem.Acquire(ctx, 1)
}
@@ -168,6 +169,14 @@ func (s *Server) IsInstalling() bool {
return true
}
func (s *Server) IsTransferring() bool {
return s.transferring.Get()
}
func (s *Server) SetTransferring(state bool) {
s.transferring.Set(state)
}
// Removes the installer container for the server.
func (ip *InstallationProcess) RemoveContainer() {
err := ip.client.ContainerRemove(ip.context, ip.Server.Id()+"_installer", types.ContainerRemoveOptions{