0
0
Fork 0

Merge remote-tracking branch 'upstream/main'

This commit is contained in:
オスカー、 2024-10-28 21:25:56 +09:00
commit 1e70b14213
No known key found for this signature in database
GPG key ID: 139D6573F92DA9F7
385 changed files with 5806 additions and 3603 deletions

View file

@ -65,6 +65,8 @@ class Account < ApplicationRecord
)
BACKGROUND_REFRESH_INTERVAL = 1.week.freeze
REFRESH_DEADLINE = 6.hours
STALE_THRESHOLD = 1.day
DEFAULT_FIELDS_SIZE = 4
INSTANCE_ACTOR_ID = -99
@ -229,13 +231,13 @@ class Account < ApplicationRecord
end
def possibly_stale?
last_webfingered_at.nil? || last_webfingered_at <= 1.day.ago
last_webfingered_at.nil? || last_webfingered_at <= STALE_THRESHOLD.ago
end
def schedule_refresh_if_stale!
return unless last_webfingered_at.present? && last_webfingered_at <= BACKGROUND_REFRESH_INTERVAL.ago
AccountRefreshWorker.perform_in(rand(6.hours.to_i), id)
AccountRefreshWorker.perform_in(rand(REFRESH_DEADLINE), id)
end
def refresh!