mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Merge commit '8a46c747dbca2999bab4493826451e4a4fa96ff8' into glitch-soc/merge-4.4
This commit is contained in:
@@ -70,6 +70,7 @@ class ConnectionPool::SharedTimedStack
|
|||||||
if @created == @max && !@queue.empty?
|
if @created == @max && !@queue.empty?
|
||||||
throw_away_connection = @queue.pop
|
throw_away_connection = @queue.pop
|
||||||
@tagged_queue[throw_away_connection.site].delete(throw_away_connection)
|
@tagged_queue[throw_away_connection.site].delete(throw_away_connection)
|
||||||
|
throw_away_connection.close
|
||||||
@create_block.call(preferred_tag)
|
@create_block.call(preferred_tag)
|
||||||
elsif @created != @max
|
elsif @created != @max
|
||||||
connection = @create_block.call(preferred_tag)
|
connection = @create_block.call(preferred_tag)
|
||||||
|
|||||||
@@ -205,7 +205,11 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
|
|||||||
|
|
||||||
def update_tags!
|
def update_tags!
|
||||||
previous_tags = @status.tags.to_a
|
previous_tags = @status.tags.to_a
|
||||||
current_tags = @status.tags = Tag.find_or_create_by_names(@raw_tags)
|
current_tags = @status.tags = @raw_tags.flat_map do |tag|
|
||||||
|
Tag.find_or_create_by_names([tag]).filter(&:valid?)
|
||||||
|
rescue ActiveRecord::RecordInvalid
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
|
||||||
return unless @status.distributable?
|
return unless @status.distributable?
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,16 @@ class MoveWorker
|
|||||||
.in_batches do |follows|
|
.in_batches do |follows|
|
||||||
ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id)
|
ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id)
|
||||||
num_moved += follows.update_all(target_account_id: @target_account.id)
|
num_moved += follows.update_all(target_account_id: @target_account.id)
|
||||||
|
|
||||||
|
# Clear any relationship cache, since callbacks are not called
|
||||||
|
Rails.cache.delete_multi(follows.flat_map do |follow|
|
||||||
|
[
|
||||||
|
['relationship', follow.account_id, follow.target_account_id],
|
||||||
|
['relationship', follow.target_account_id, follow.account_id],
|
||||||
|
['relationship', follow.account_id, @target_account.id],
|
||||||
|
['relationship', @target_account.id, follow.account_id],
|
||||||
|
]
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
num_moved
|
num_moved
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
|
|||||||
tag: [
|
tag: [
|
||||||
{ type: 'Hashtag', name: 'foo' },
|
{ type: 'Hashtag', name: 'foo' },
|
||||||
{ type: 'Hashtag', name: 'bar' },
|
{ type: 'Hashtag', name: 'bar' },
|
||||||
|
{ type: 'Hashtag', name: '#2024' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user