This commit is contained in:
Shenle Lu 2026-02-19 16:47:50 -08:00 committed by GitHub
commit 9d0be5499e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,9 @@
package metric
import (
"errors"
"io"
"github.com/go-chi/chi/v5"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
@ -648,7 +651,7 @@ func AddMetricsEndpoint(metricsPath string, handler chi.Router) {
func TransferCompleted(bytesSent, bytesReceived int64, transferKind int, err error, isSFTPFs bool) {
if transferKind == 0 {
// upload
if err == nil {
if err == nil || errors.Is(err, io.EOF) {
totalUploads.Inc()
} else {
totalUploadErrors.Inc()