Merge commit '0ad2413b35287958f59073a5b63aecc659a64d98' into glitch-soc/merge-upstream
Conflicts: - `app/javascript/styles/mastodon/forms.scss`: Conflict because we ran eslint autofix on upstream files. - `config/initializers/content_security_policy.rb`: Code style changes but we have a different version. Kept our version. - `streaming/index.js`: Upstream fixed a typo close to glitch-soc-only code. Applied upstream's changes.
This commit is contained in:
@@ -37,7 +37,17 @@ class ConnectionPool::SharedConnectionPool < ConnectionPool
|
||||
end
|
||||
|
||||
def checkin(preferred_tag)
|
||||
if ::Thread.current[key(preferred_tag)]
|
||||
if preferred_tag.is_a?(Hash) && preferred_tag[:force]
|
||||
# ConnectionPool 2.4+ calls `checkin(force: true)` after fork.
|
||||
# When this happens, we should remove all connections from Thread.current
|
||||
|
||||
::Thread.current.keys.each do |name| # rubocop:disable Style/HashEachMethods
|
||||
next unless name.to_s.start_with?("#{@key}-")
|
||||
|
||||
@available.push(::Thread.current[name])
|
||||
::Thread.current[name] = nil
|
||||
end
|
||||
elsif ::Thread.current[key(preferred_tag)]
|
||||
if ::Thread.current[key_count(preferred_tag)] == 1
|
||||
@available.push(::Thread.current[key(preferred_tag)])
|
||||
::Thread.current[key(preferred_tag)] = nil
|
||||
|
||||
Reference in New Issue
Block a user