🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
fix(scanner): make activity panel update rate configurable
Deluan92a1f19271de
diff --git a/conf/configuration.go b/conf/configuration.goindex aa4f7785b..7b68cb04b 100644--- a/conf/configuration.go+++ b/conf/configuration.go@@ -100,6 +100,7 @@ type configOptions struct {DevAutoCreateAdminPassword stringDevAutoLoginUsername stringDevActivityPanel bool+ DevActivityPanelUpdateRate time.DurationDevSidebarPlaylists boolDevEnableBufferedScrobble boolDevShowArtistPage bool@@ -370,6 +371,7 @@ func init() {viper.SetDefault("devautocreateadminpassword", "")viper.SetDefault("devautologinusername", "")viper.SetDefault("devactivitypanel", true)+ viper.SetDefault("devactivitypanelupdaterate", 300*time.Millisecond)viper.SetDefault("enablesharing", false)viper.SetDefault("shareurl", "")viper.SetDefault("defaultdownloadableshare", false)diff --git a/scanner/scanner.go b/scanner/scanner.goindex 4bcf8658f..1e7dee417 100644--- a/scanner/scanner.go+++ b/scanner/scanner.go@@ -7,6 +7,7 @@ import ("sync""time"+ "github.com/navidrome/navidrome/conf""github.com/navidrome/navidrome/core""github.com/navidrome/navidrome/core/artwork""github.com/navidrome/navidrome/log"@@ -119,7 +120,7 @@ func (s *scanner) startProgressTracker(library string) (chan uint32, context.Can// Must be a new context (not the one passed to the scan method) to allow broadcasting the scan status to all clientsctx, cancel := context.WithCancel(context.Background())progress := make(chan uint32, 1000)- limiter := rate.Sometimes{Every: 10}+ limiter := rate.Sometimes{Interval: conf.Server.DevActivityPanelUpdateRate}go func() {s.broker.SendMessage(ctx, &events.ScanStatus{Scanning: true, Count: 0, FolderCount: 0})defer func() {