Push discovered status through streaming API within a time window (#6484)
Time window of 6 hoursremotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
parent
a7c50c7aba
commit
a71af98401
|
@ -74,7 +74,7 @@ class ActivityPub::Activity
|
||||||
|
|
||||||
# Only continue if the status is supposed to have
|
# Only continue if the status is supposed to have
|
||||||
# arrived in real-time
|
# arrived in real-time
|
||||||
return unless @options[:override_timestamps]
|
return unless @options[:override_timestamps] || status.within_realtime_window?
|
||||||
|
|
||||||
distribute_to_followers(status)
|
distribute_to_followers(status)
|
||||||
end
|
end
|
||||||
|
|
|
@ -61,7 +61,7 @@ class OStatus::Activity::Creation < OStatus::Activity::Base
|
||||||
Rails.logger.debug "Queuing remote status #{status.id} (#{id}) for distribution"
|
Rails.logger.debug "Queuing remote status #{status.id} (#{id}) for distribution"
|
||||||
|
|
||||||
LinkCrawlWorker.perform_async(status.id) unless status.spoiler_text?
|
LinkCrawlWorker.perform_async(status.id) unless status.spoiler_text?
|
||||||
DistributionWorker.perform_async(status.id) if @options[:override_timestamps]
|
DistributionWorker.perform_async(status.id) if @options[:override_timestamps] || status.within_realtime_window?
|
||||||
|
|
||||||
status
|
status
|
||||||
end
|
end
|
||||||
|
|
|
@ -80,6 +80,8 @@ class Status < ApplicationRecord
|
||||||
|
|
||||||
delegate :domain, to: :account, prefix: true
|
delegate :domain, to: :account, prefix: true
|
||||||
|
|
||||||
|
REAL_TIME_WINDOW = 6.hours
|
||||||
|
|
||||||
def searchable_by(preloaded = nil)
|
def searchable_by(preloaded = nil)
|
||||||
ids = [account_id]
|
ids = [account_id]
|
||||||
|
|
||||||
|
@ -108,6 +110,10 @@ class Status < ApplicationRecord
|
||||||
!reblog_of_id.nil?
|
!reblog_of_id.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def within_realtime_window?
|
||||||
|
created_at >= REAL_TIME_WINDOW.ago
|
||||||
|
end
|
||||||
|
|
||||||
def verb
|
def verb
|
||||||
if destroyed?
|
if destroyed?
|
||||||
:delete
|
:delete
|
||||||
|
|
Loading…
Reference in New Issue