fix(agent): v0.3.10 cleanup orphan instance dirs on startup

- Add cleanupOrphanInstanceDirs() to remove leftover instance directories
  after failed deletes (common on Windows when compose.log is locked)
- Log RemoveAll errors in dockerComposeRm for better visibility
- Bump version to 0.3.10 and rebuild binaries
This commit is contained in:
EduBox Dev
2026-06-27 21:36:02 +00:00
parent e946b22a42
commit 33d89c66c0
5 changed files with 54 additions and 12 deletions
+6 -1
View File
@@ -2,6 +2,7 @@ package main
import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
@@ -92,7 +93,11 @@ func dockerComposeRm(dataDir, instanceID string) error {
if err := cmd.Run(); err != nil {
return err
}
return os.RemoveAll(dir)
if err := os.RemoveAll(dir); err != nil {
log.Printf("dockerComposeRm: failed to remove %s: %v (will retry on next startup)", dir, err)
return err
}
return nil
}
// extractPublicURL tries to find the public URL from a WordPress compose config.