Merge commit '7c8ca0c6d6' into kb-draft-5.16-lts

This commit is contained in:
KMY 2024-02-15 08:15:29 +09:00
commit 9190f53d7b
16 changed files with 213 additions and 34 deletions

View file

@ -362,6 +362,16 @@ class User < ApplicationRecord
Doorkeeper::AccessToken.by_resource_owner(self).in_batches do |batch|
batch.update_all(revoked_at: Time.now.utc)
Web::PushSubscription.where(access_token_id: batch).delete_all
# Revoke each access token for the Streaming API, since `update_all``
# doesn't trigger ActiveRecord Callbacks:
# TODO: #28793 Combine into a single topic
payload = Oj.dump(event: :kill)
redis.pipelined do |pipeline|
batch.ids.each do |id|
pipeline.publish("timeline:access_token:#{id}", payload)
end
end
end
end