# Sidekiq 重新分叉后站点设置过时

**URL:** <https://meta.discourse.org/t/site-settings-are-stale-in-sidekiq-after-it-re-forks/408094>\
**Category:** Bug\
**Created:** [2026年七月20日 23:51 UTC](https://meta.discourse.org/t/site-settings-are-stale-in-sidekiq-after-it-re-forks/408094 "2026-07-20T23:51:10Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2026年七月21日 03:11 UTC](https://meta.discourse.org/t/site-settings-are-stale-in-sidekiq-after-it-re-forks/408094/3 "2026-07-21T03:11:01Z")

</div>

感谢您的报告！我已在以下链接中提交了一个修复方案：

> <https://github.com/discourse/discourse/pull/41856>
>
> Discourse keeps site settings in memory so it does not need to read them from th…e database for every request or job.
> 
> Pitchfork starts Sidekiq from a long-running parent process. That parent can still have the site settings that were loaded when Discourse first started. When an admin changes a setting, the running Sidekiq process gets the new value through MessageBus, but the parent can keep the old value.
> 
> If Sidekiq is later restarted, the new Sidekiq process copies the old settings from its parent. For example, after changing \`site\_contact\_username\`, a restarted Sidekiq process could send system messages from the previous account. The wrong value remained in use until another setting changed or Discourse was restarted.
> 
> This change reloads site settings from the database after Discourse starts a new process. It starts listening for new setting changes before the reload, so a change made during startup is not missed. On multisite installations, it reloads each site separately.
> 
> The reload only updates memory in the new process. It does not clear shared caches or send another MessageBus message, which avoids extra work when several processes restart at the same time.
> 
> Reported at https://meta.discourse.org/t/site-settings-are-stale-in-sidekiq-after-it-re-forks/408094

---

_[View the full topic](https://meta.discourse.org/t/site-settings-are-stale-in-sidekiq-after-it-re-forks/408094)._
