mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-24 11:12:42 +00:00
Relay reset delivery tracker model spec and callback (#36027)
This commit is contained in:
parent
05a655f33e
commit
1b664cf20d
2 changed files with 15 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue