fix(ai): replace os.MkdirAll with coreio.Local.EnsureDir in metrics
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 1m12s

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-16 18:30:55 +00:00
parent be522ad68f
commit 02b04f9bb5

View file

@ -10,6 +10,8 @@ import (
"slices"
"sync"
"time"
coreio "forge.lthn.ai/core/go-io"
)
// metricsMu protects concurrent file writes in Record.
@ -54,7 +56,7 @@ func Record(event Event) (err error) {
return err
}
if err := os.MkdirAll(dir, 0o755); err != nil {
if err := coreio.Local.EnsureDir(dir); err != nil {
return fmt.Errorf("create metrics directory: %w", err)
}