Change port check

This commit is contained in:
Magnus Root 2026-05-15 15:45:55 +03:00
parent 4116830a76
commit 19fecf0b5c

View file

@ -200,6 +200,8 @@ func setupContainers(config Config, clientTitle string, clientInfo *ClientInfo,
if err := saveContainerPorts(containerDir, containerNum, resources, containerPorts); err != nil { if err := saveContainerPorts(containerDir, containerNum, resources, containerPorts); err != nil {
log.Printf(" ⚠ Ошибка сохранения портов: %v", err) log.Printf(" ⚠ Ошибка сохранения портов: %v", err)
} }
} else {
log.Printf(" ⚠ Контейнер %s не был пересоздан — будет повторная попытка при следующем запуске", containerFullName)
} }
continue continue
} }
@ -243,7 +245,13 @@ func setupContainers(config Config, clientTitle string, clientInfo *ClientInfo,
} }
} }
if !portsOK { if !portsOK {
recreateContainer(containerFullName, composeFile, containerDir, clientTitle, resources, resourcePortMap, containerNum) updateLockStatus(fmt.Sprintf("recreating container (ports): %s", containerFullName))
success := recreateContainer(containerFullName, composeFile, containerDir, clientTitle, resources, resourcePortMap, containerNum)
if success {
if err := saveContainerPorts(containerDir, containerNum, resources, containerPorts); err != nil {
log.Printf(" ⚠ Ошибка сохранения портов: %v", err)
}
}
continue continue
} }
} }