Nexus 5なら物理クラッシュして壊しちゃったよ←
[master勢のみ] Mastodon の 不完全な ActivityPub 対応を取り除く - 雪餅の鯖缶日誌 https://blog.yukimochi.io/2017/08/master-mastodon-activitypub.html をやってみた
> SELECT COUNT(1) FROM accounts WHERE protocol=1;
count
-------
198
(1 row)
が作業前後で変わらなかったんだけどまあいいかw
更新時はエラーが出ても続けるようにrescueをいくつか
Account.where(protocol: :activitypub).each do |acc|
begin
print '.'
ResolveRemoteAccountService.new.call(acc.acct)
rescue HTTP::TimeoutError, Mastodon::UnexpectedResponseError => e
puts "\n#{acc.id} #{acc.username} #{acc.domain} : #{e}"
end
end
Account.where(protocol: :activitypub).each do |acc|
begin
print '.'
ResolveRemoteAccountService.new.call(acc.acct)
rescue HTTP::TimeoutError, Mastodon::UnexpectedResponseError => e
puts "\n#{acc.id} #{acc.username} #{acc.domain} : #{e}"
end
end
再購読のコードはこちら
Account.remote.with_followers.where.not(subscription_expires_at: nil).find_each do |a|
begin
print '.'
SubscribeService.new.call(a)
rescue OpenSSL::SSL::SSLError, HTTP::ConnectionError => e
puts "\n#{a.id} #{a.username} #{a.domain} : #{e}"
end
end
@YUKIMOCHI ループは回ってたので1.5.1ぴったりのコードでも where(protocol: :activitypub) は期待どおりうごいてる感じでした。
> Account.where(protocol: :activitypub).length
=> 198
> SELECT COUNT(1) FROM accounts WHERE protocol=1;
count
-------
198
(1 row)
ActivityPub勢の多いインスタンスは下記のような感じ。
> SELECT COUNT(1), domain FROM accounts WHERE protocol=1 GROUP BY domain HAVING COUNT(1) > 5 ORDER BY 1 DESC;
count | domain
-------+-----------------
53 | mstdn.jp
21 | pawoo.net
13 | mstdn.guru
13 | mstdn.maud.io
10 | mastodon.social
(5 rows)
このインスタンス、ローカルなアカウントは僕しか居ないんだけどホームタイムラインにないトゥートが連合タイムラインにあることがあるんだよね。
@ykzts@omanko.porn 確認できました!確かにフォローしている人の会話先が連合タイムラインのみに表示されました。