fix: do not try to reset machine when removing unreachable machine

This commit is contained in:
Pasha Sviderski
2025-08-06 15:11:27 +10:00
parent fc0bf4a91b
commit 6c244bb8f9
3 changed files with 13 additions and 16 deletions
+1 -4
View File
@@ -446,10 +446,7 @@ func (m *Machine) Run(ctx context.Context) error {
slog.Info("Local API proxy server stopped.")
// Clean up the machine data and resources if the machine shutdown was initiated by a reset.
m.mu.RLock()
resetting := m.resetting
m.mu.RUnlock()
if resetting {
if m.resetting {
slog.Info("Cleaning up machine data and resources.")
if err = m.cleanup(); err != nil {
slog.Error("Failed to clean up machine data and resources.", "err", err)