From 57bbba3051ff7a4c7b4d55533e4cf584dc0b4460 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 29 Jan 2025 18:39:29 +0000 Subject: [PATCH] Demote `wakeQueueIfEventsPending` and thumbnailer log lines to debug (#3520) This just produces a lot of noise in the logs for no reason and they didn't even say which queues or thumbnails were relevant. Signed-off-by: Neil Alexander --------- Signed-off-by: Neil Alexander Co-authored-by: Neil Alexander --- federationapi/queue/destinationqueue.go | 2 +- mediaapi/thumbnailer/thumbnailer.go | 6 +++--- mediaapi/thumbnailer/thumbnailer_bimg.go | 2 +- mediaapi/thumbnailer/thumbnailer_nfnt.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/federationapi/queue/destinationqueue.go b/federationapi/queue/destinationqueue.go index 136ad509..f514d141 100644 --- a/federationapi/queue/destinationqueue.go +++ b/federationapi/queue/destinationqueue.go @@ -147,7 +147,7 @@ func (oq *destinationQueue) wakeQueueIfEventsPending(forceWakeup bool) { // or if forceWakeup is true. Otherwise there is no reason to start the // queue goroutine and waste resources. if forceWakeup || eventsPending() { - logrus.Info("Starting queue due to pending events or forceWakeup") + logrus.Debugf("Starting queue %q -> %q due to pending events or forceWakeup", oq.origin, oq.destination) oq.wakeQueueAndNotify() } } diff --git a/mediaapi/thumbnailer/thumbnailer.go b/mediaapi/thumbnailer/thumbnailer.go index 31f616da..88857f69 100644 --- a/mediaapi/thumbnailer/thumbnailer.go +++ b/mediaapi/thumbnailer/thumbnailer.go @@ -86,7 +86,7 @@ func getActiveThumbnailGeneration(dst types.Path, _ types.ThumbnailSize, activeT activeThumbnailGeneration.Lock() defer activeThumbnailGeneration.Unlock() if activeThumbnailGenerationResult, ok := activeThumbnailGeneration.PathToResult[string(dst)]; ok { - logger.Info("Waiting for another goroutine to generate the thumbnail.") + logger.Debugf("Waiting for another goroutine to generate the thumbnail %q", dst) // NOTE: Wait unlocks and locks again internally. There is still a deferred Unlock() that will unlock this. activeThumbnailGenerationResult.Cond.Wait() @@ -115,7 +115,7 @@ func broadcastGeneration(dst types.Path, activeThumbnailGeneration *types.Active activeThumbnailGeneration.Lock() defer activeThumbnailGeneration.Unlock() if activeThumbnailGenerationResult, ok := activeThumbnailGeneration.PathToResult[string(dst)]; ok { - logger.Info("Signalling other goroutines waiting for this goroutine to generate the thumbnail.") + logger.Debugf("Signalling other goroutines waiting for this goroutine to generate the thumbnail %q", dst) // Note: errorReturn is a named return value error that is signalled from here to waiting goroutines activeThumbnailGenerationResult.Err = errorReturn activeThumbnailGenerationResult.Cond.Broadcast() @@ -136,7 +136,7 @@ func isThumbnailExists( config.Width, config.Height, config.ResizeMethod, ) if err != nil { - logger.Error("Failed to query database for thumbnail.") + logger.Errorf("Failed to query database for thumbnail %q", dst) return false, err } if thumbnailMetadata != nil { diff --git a/mediaapi/thumbnailer/thumbnailer_bimg.go b/mediaapi/thumbnailer/thumbnailer_bimg.go index e2c297b5..8bb8b2d2 100644 --- a/mediaapi/thumbnailer/thumbnailer_bimg.go +++ b/mediaapi/thumbnailer/thumbnailer_bimg.go @@ -153,7 +153,7 @@ func createThumbnail( "ActualWidth": width, "ActualHeight": height, "processTime": time.Now().Sub(start), - }).Info("Generated thumbnail") + }).Debugf("Generated thumbnail %q", dst) stat, err := os.Stat(string(dst)) if err != nil { diff --git a/mediaapi/thumbnailer/thumbnailer_nfnt.go b/mediaapi/thumbnailer/thumbnailer_nfnt.go index f4a36606..bd1e820b 100644 --- a/mediaapi/thumbnailer/thumbnailer_nfnt.go +++ b/mediaapi/thumbnailer/thumbnailer_nfnt.go @@ -191,7 +191,7 @@ func createThumbnail( "ActualWidth": width, "ActualHeight": height, "processTime": time.Since(start), - }).Info("Generated thumbnail") + }).Debugf("Generated thumbnail %q", dst) stat, err := os.Stat(string(dst)) if err != nil {