Push discovered status through streaming API within a time window (#6484)
Time window of 6 hours
This commit is contained in:
parent
a7c50c7aba
commit
a71af98401
3 changed files with 8 additions and 2 deletions
|
@ -80,6 +80,8 @@ class Status < ApplicationRecord
|
|||
|
||||
delegate :domain, to: :account, prefix: true
|
||||
|
||||
REAL_TIME_WINDOW = 6.hours
|
||||
|
||||
def searchable_by(preloaded = nil)
|
||||
ids = [account_id]
|
||||
|
||||
|
@ -108,6 +110,10 @@ class Status < ApplicationRecord
|
|||
!reblog_of_id.nil?
|
||||
end
|
||||
|
||||
def within_realtime_window?
|
||||
created_at >= REAL_TIME_WINDOW.ago
|
||||
end
|
||||
|
||||
def verb
|
||||
if destroyed?
|
||||
:delete
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue