Merge branch 'main' into glitch-soc/merge-upstream
This commit is contained in:
@@ -188,8 +188,7 @@ class DeleteAccountService < BaseService
|
||||
ids = favourites.pluck(:status_id)
|
||||
StatusStat.where(status_id: ids).update_all('favourites_count = GREATEST(0, favourites_count - 1)')
|
||||
Chewy.strategy.current.update(StatusesIndex::Status, ids) if Chewy.enabled?
|
||||
# Rails.cache.delete_multi would be better, but we don't have it yet
|
||||
ids.each { |id| Rails.cache.delete("statuses/#{id}") }
|
||||
Rails.cache.delete_multi(ids.map { |id| "statuses/#{id}" })
|
||||
favourites.delete_all
|
||||
end
|
||||
end
|
||||
|
||||
@@ -45,7 +45,7 @@ class ImportService < BaseService
|
||||
items = @data.take(ROWS_PROCESSING_LIMIT).map { |row| row['#domain'].strip }
|
||||
|
||||
if @import.overwrite?
|
||||
presence_hash = items.each_with_object({}) { |id, mapping| mapping[id] = true }
|
||||
presence_hash = items.index_with(true)
|
||||
|
||||
@account.domain_blocks.find_each do |domain_block|
|
||||
if presence_hash[domain_block.domain]
|
||||
@@ -96,7 +96,7 @@ class ImportService < BaseService
|
||||
items = @data.take(ROWS_PROCESSING_LIMIT).map { |row| row['#uri'].strip }
|
||||
|
||||
if @import.overwrite?
|
||||
presence_hash = items.each_with_object({}) { |id, mapping| mapping[id] = true }
|
||||
presence_hash = items.index_with(true)
|
||||
|
||||
@account.bookmarks.find_each do |bookmark|
|
||||
if presence_hash[bookmark.status.uri]
|
||||
|
||||
Reference in New Issue
Block a user