From 8b9ea5655640e2990e9b111a2e51cc374e8ce358 Mon Sep 17 00:00:00 2001 From: g0rbe Date: Thu, 27 Jul 2023 20:28:01 +0200 Subject: [PATCH] rename total to size in stat --- db/scanner.go | 4 ++-- db/schemas.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/db/scanner.go b/db/scanner.go index 864a783..6501b0f 100644 --- a/db/scanner.go +++ b/db/scanner.go @@ -53,9 +53,9 @@ func ScannerGetIndexes() ([]ScannerSchema, error) { return nil, fmt.Errorf("failed to decode: %w", err) } - err = sc.UpdateTotal() + err = sc.UpdateSize() if err != nil { - return nil, fmt.Errorf("failed to update total of %s: %w", sc.Name, err) + return nil, fmt.Errorf("failed to update size of %s: %w", sc.Name, err) } scs = append(scs, *sc) diff --git a/db/schemas.go b/db/schemas.go index 97ed36e..0ceffcd 100644 --- a/db/schemas.go +++ b/db/schemas.go @@ -70,22 +70,22 @@ func (d *DomainSchema) FullDomain() string { type ScannerSchema struct { Name string `bson:"name" json:"name"` Index int64 `bson:"index" json:"index"` - Total int64 `bson:"-" json:"total"` + Size int64 `bson:"-" json:"size"` } -func (s *ScannerSchema) UpdateTotal() error { +func (s *ScannerSchema) UpdateSize() error { l := ctlog.LogByName(s.Name) if l == nil { return fmt.Errorf("invalid name") } - total, err := ctlog.Size(l.URI) + size, err := ctlog.Size(l.URI) if err != nil { return fmt.Errorf("failed to get size: %w", err) } - s.Total = total + s.Size = size return nil }