From 9e3e884dac7771eabaf84b728fc2db3e443b3412 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 30 May 2026 15:03:14 +0200 Subject: [PATCH] refactor(metrics): drop inline file count tracking The file count is now read from the database on demand. --- pkg/files/files.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/files/files.go b/pkg/files/files.go index a103a5237..a8d702913 100644 --- a/pkg/files/files.go +++ b/pkg/files/files.go @@ -28,8 +28,6 @@ import ( "code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/db" "code.vikunja.io/api/pkg/log" - "code.vikunja.io/api/pkg/metrics" - "code.vikunja.io/api/pkg/modules/keyvalue" "code.vikunja.io/api/pkg/web" "github.com/c2h5oh/datasize" @@ -205,7 +203,7 @@ func (f *File) Delete(s *xorm.Session) (err error) { return err } - return keyvalue.DecrBy(metrics.FilesCountKey, 1) + return nil } // Save saves a file to storage @@ -214,5 +212,5 @@ func (f *File) Save(fcontent io.ReadSeeker) error { if err != nil { return fmt.Errorf("failed to save file: %w", err) } - return keyvalue.IncrBy(metrics.FilesCountKey, 1) + return nil }