fix(logging): log errors during file-backed source cleanup

This commit is contained in:
Luis Pater
2026-05-29 11:24:58 +08:00
parent 4ade13a374
commit 7d9980e8fa

View File

@@ -12,6 +12,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/router-for-me/CLIProxyAPI/v7/internal/interfaces"
"github.com/router-for-me/CLIProxyAPI/v7/internal/logging"
log "github.com/sirupsen/logrus"
)
const requestBodyOverrideContextKey = "REQUEST_BODY_OVERRIDE"
@@ -570,6 +571,8 @@ func cleanupFileBodySources(sources ...*logging.FileBodySource) {
if source == nil {
continue
}
_ = source.Cleanup()
if errCleanup := source.Cleanup(); errCleanup != nil {
log.WithError(errCleanup).Warn("failed to clean up log part files")
}
}
}