Add timeout for waiting for state

This commit is contained in:
Ingo Oppermann 2025-07-22 16:02:09 +02:00
parent 5e1295b4c3
commit 36470072f4
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E

View File

@ -802,7 +802,12 @@ func (p *process) stop(wait bool, reason string) error {
}
// If the process in starting state, wait until the process has been started
start := time.Now()
for {
if time.Since(start) > 5*time.Second {
return nil
}
if p.getState() == stateStarting {
time.Sleep(100 * time.Millisecond)
continue