chore(healthcheck): better repo size log
All checks were successful
submodules sync / sync (push) Successful in 38s
build / build (push) Successful in 1m18s
build / trigger-build-image (push) Successful in 8s

This commit is contained in:
张泊明518370910136 2024-12-05 12:45:28 -05:00
parent 0f5ccf8af2
commit 85e53f4f90
GPG Key ID: D47306D7062CDA9D

View File

@ -16,7 +16,7 @@ func RepoSize(confSize float64) error {
cmd := exec.Command("git", "count-objects", "-v") cmd := exec.Command("git", "count-objects", "-v")
output, err := cmd.CombinedOutput() output, err := cmd.CombinedOutput()
if err != nil { if err != nil {
slog.Error("running git command:", "err", err) slog.Error("running git command:", "err", err, "output", output)
return fmt.Errorf("error running git command: %w", err) return fmt.Errorf("error running git command: %w", err)
} }
lines := strings.Split(string(output), "\n") lines := strings.Split(string(output), "\n")
@ -27,8 +27,8 @@ func RepoSize(confSize float64) error {
sizeStr := fields[1] sizeStr := fields[1]
size, err := strconv.Atoi(sizeStr) size, err := strconv.Atoi(sizeStr)
if err != nil { if err != nil {
slog.Error("running git command:", "err", err) slog.Error("parsing repo size:", "err", err, "line", line)
return fmt.Errorf("error running git command: %w", err) return fmt.Errorf("error parsing repo size: %w", err)
} }
sum += size sum += size
} }