Skip to content

Commit 7d9980e

Browse files
committed
fix(logging): log errors during file-backed source cleanup
1 parent 4ade13a commit 7d9980e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

internal/api/middleware/response_writer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/gin-gonic/gin"
1313
"github.com/router-for-me/CLIProxyAPI/v7/internal/interfaces"
1414
"github.com/router-for-me/CLIProxyAPI/v7/internal/logging"
15+
log "github.com/sirupsen/logrus"
1516
)
1617

1718
const requestBodyOverrideContextKey = "REQUEST_BODY_OVERRIDE"
@@ -570,6 +571,8 @@ func cleanupFileBodySources(sources ...*logging.FileBodySource) {
570571
if source == nil {
571572
continue
572573
}
573-
_ = source.Cleanup()
574+
if errCleanup := source.Cleanup(); errCleanup != nil {
575+
log.WithError(errCleanup).Warn("failed to clean up log part files")
576+
}
574577
}
575578
}

0 commit comments

Comments
 (0)