Relay reset delivery tracker model spec and callback (#36027)

This commit is contained in:
Matt Jankowski 2025-09-05 08:56:15 -04:00 committed by GitHub
parent 05a655f33e
commit 1b664cf20d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 6 deletions

View file

@ -34,7 +34,7 @@ class Relay < ApplicationRecord
payload = Oj.dump(follow_activity(activity_id))
update!(state: :pending, follow_activity_id: activity_id)
DeliveryFailureTracker.reset!(inbox_url)
reset_delivery_tracker
ActivityPub::DeliveryWorker.perform_async(payload, some_local_account.id, inbox_url)
end
@ -43,12 +43,16 @@ class Relay < ApplicationRecord
payload = Oj.dump(unfollow_activity(activity_id))
update!(state: :idle, follow_activity_id: nil)
DeliveryFailureTracker.reset!(inbox_url)
reset_delivery_tracker
ActivityPub::DeliveryWorker.perform_async(payload, some_local_account.id, inbox_url)
end
private
def reset_delivery_tracker
DeliveryFailureTracker.reset!(inbox_url)
end
def follow_activity(activity_id)
{
'@context': ActivityPub::TagManager::CONTEXT,