mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:14:17 +08:00
PERF: Use user-specific channel for message-bus logout (#19719)
Using a shared channel means that every user receives an update to the 'last_id' when *any* other user is logged out. If many users are being programmatically logged out at the same time, this can cause a very large number of message-bus polls. This commit switches to use a user-specific channel, which means that each user has its own 'last id' which will only increment when they are logged out
This commit is contained in:
@ -2020,7 +2020,7 @@ RSpec.describe User do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
|
||||
it 'should publish the right message' do
|
||||
message = MessageBus.track_publish('/logout') { user.logged_out }.first
|
||||
message = MessageBus.track_publish("/logout/#{user.id}") { user.logged_out }.first
|
||||
|
||||
expect(message.data).to eq(user.id)
|
||||
end
|
||||
|
Reference in New Issue
Block a user