From 3d59740a0a151d199aa48d9e6ea754c0abf988a2 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 10 Sep 2024 15:49:17 +0200 Subject: [PATCH] chore(stdiscosrv): database writing logging --- cmd/stdiscosrv/database.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/stdiscosrv/database.go b/cmd/stdiscosrv/database.go index 24291378c..c016a5ec8 100644 --- a/cmd/stdiscosrv/database.go +++ b/cmd/stdiscosrv/database.go @@ -214,7 +214,9 @@ func (s *inMemoryStore) calculateStatistics() { func (s *inMemoryStore) write() (err error) { t0 := time.Now() + log.Println("Writing database") defer func() { + log.Println("Finished writing database") if err == nil { databaseWriteSeconds.Set(time.Since(t0).Seconds()) databaseLastWritten.Set(float64(t0.Unix())) @@ -276,6 +278,7 @@ func (s *inMemoryStore) write() (err error) { if os.Getenv("PODINDEX") == "0" { // Upload to S3 + log.Println("Uploading database") fd, err = os.Open(dbf) if err != nil { log.Printf("Error uploading database to S3: %v", err) @@ -285,6 +288,7 @@ func (s *inMemoryStore) write() (err error) { if err := s3Upload(fd); err != nil { log.Printf("Error uploading database to S3: %v", err) } + log.Println("Finished uploading database") } return nil