diff --git a/CHANGELOG.md b/CHANGELOG.md index b39eddb0d4d9fc1cc53af6885deaf46877359564..4012c30e67914cdda3423b42ad096cecf4a39d20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,7 +121,8 @@ path/server, for example, then you can simply update the path in the config for * URL previews now follow redirects properly. * Overall memory usage is improved, particularly during media uploads. - * Note: If you use plugins then memory usage will still be somewhat high due to temporary caching of uploads. + * Note: If you use plugins then memory usage will still be somewhat high due to temporary caching of uploads. +* Fixed shutdown stall if the config was reloaded more than once while running. ## [1.2.13] - February 12, 2023 diff --git a/cmd/media_repo/reloads.go b/cmd/media_repo/reloads.go index f1e8eda17ee9f39925ef1f9960951cc95f5e8b35..d197cd76ca96ffc06839f1fa478a08a65de5ea1b 100644 --- a/cmd/media_repo/reloads.go +++ b/cmd/media_repo/reloads.go @@ -121,6 +121,8 @@ func reloadAccessTokensOnChan(reloadChan chan bool) { shouldReload := <-reloadChan if shouldReload { _auth_cache.FlushCache() + } else { + return // received stop } } }() @@ -135,6 +137,7 @@ func reloadCacheOnChan(reloadChan chan bool) { redislib.Reconnect() } else { redislib.Stop() + return // received stop } } }() @@ -149,6 +152,7 @@ func reloadPluginsOnChan(reloadChan chan bool) { plugins.ReloadPlugins() } else { plugins.StopPlugins() + return // received stop } } }() @@ -163,6 +167,7 @@ func reloadPoolOnChan(reloadChan chan bool) { pool.AdjustSize() } else { pool.Drain() + return // received stop } } }() @@ -175,6 +180,8 @@ func reloadErrorCachesOnChan(reloadChan chan bool) { shouldReload := <-reloadChan if shouldReload { errcache.AdjustSize() + } else { + return // received stop } } }()