misskey.io が数時間の障害に見舞われていたため、投稿の再送を行いました。
サーバーによって最適なアプローチは異なります。今回の前提は以下の通りです。
- おひとり様サーバー
- リモートユーザーがほとんど、ローカルユーザーはごくわずか
- リモート投稿がほとんど、ローカル投稿は相対的には少ない
- ローカル投稿は相対的には少ないが、それでも全体を列挙できるほど少なくはない
以下のようにして、特定期間のローカル投稿を全て洗い出して全ての関連するinboxに再送します。
since_id = (Time.parse('2026-03-29 02:25:00 UTC').to_f * 1000).to_i << 16
until_id = (Time.parse('2026-03-29 16:50:00 UTC').to_f * 1000).to_i << 16
count = 0
Account.local.where(suspended_at: nil).find_each do |account|
Status.where(account_id: account.id)
.where(id: since_id...until_id)
.where(deleted_at: nil)
.reorder(id: :asc)
.pluck(:id)
.each do |status_id|
ActivityPub::DistributionWorker.perform_async(status_id)
count += 1
end
end