fix: Remove Stale notification Job

This commit is contained in:
Sojan 2022-08-10 14:32:45 +02:00
parent 10d0eb063f
commit 37d6430b6a

View file

@ -10,7 +10,7 @@ class Migration::RemoveStaleNotificationsJob < ApplicationJob
def remove_invalid_messages def remove_invalid_messages
deleted_ids = [] deleted_ids = []
Message.distinct.pluck(:inbox_id).each_slice(1000) do |id_list| Message.unscoped.distinct.pluck(:inbox_id).each_slice(1000) do |id_list|
deleted_ids << (id_list - Inbox.where(id: id_list).pluck(:id)) deleted_ids << (id_list - Inbox.where(id: id_list).pluck(:id))
end end