Improve performance of deleting OAuth tokens

This commit is contained in:
Claire
2024-02-12 13:29:36 +01:00
parent 56e11650e5
commit d509dda192
3 changed files with 16 additions and 6 deletions

View File

@@ -25,8 +25,13 @@ module ApplicationExtension
def push_to_streaming_api
# TODO: #28793 Combine into a single topic
access_tokens.in_batches.each do |token|
redis.publish("timeline:access_token:#{token.id}", Oj.dump(event: :kill))
payload = Oj.dump(event: :kill)
access_tokens.in_batches do |tokens|
redis.pipelined do |pipeline|
tokens.ids.each do |id|
pipeline.publish("timeline:access_token:#{id}", payload)
end
end
end
end
end