From 6e607f97a38648eda689e69ab47e4e0e46c080f9 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 2 Apr 2025 02:43:46 -0400 Subject: [PATCH] Extract constant for `Poll` last fetch duration check (#34341) --- app/models/poll.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/poll.rb b/app/models/poll.rb index 7c59339b7e..25ce9c3be9 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -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?