Extract constant for Poll last fetch duration check ()

This commit is contained in:
Matt Jankowski 2025-04-02 02:43:46 -04:00 committed by GitHub
parent e8270e2807
commit 6e607f97a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,6 +23,8 @@
class Poll < ApplicationRecord
include Expireable
MAKE_FETCH_HAPPEN = 1.minute
belongs_to :account
belongs_to :status
@ -113,7 +115,7 @@ class Poll < ApplicationRecord
end
def time_passed_since_last_fetch?
last_fetched_at.nil? || last_fetched_at < 1.minute.ago
last_fetched_at.nil? || last_fetched_at < MAKE_FETCH_HAPPEN.ago
end
def show_totals_now?