Extract constant for Poll last fetch duration check (#34341)
				
					
				
			This commit is contained in:
		@@ -23,6 +23,8 @@
 | 
				
			|||||||
class Poll < ApplicationRecord
 | 
					class Poll < ApplicationRecord
 | 
				
			||||||
  include Expireable
 | 
					  include Expireable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  MAKE_FETCH_HAPPEN = 1.minute
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  belongs_to :account
 | 
					  belongs_to :account
 | 
				
			||||||
  belongs_to :status
 | 
					  belongs_to :status
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -113,7 +115,7 @@ class Poll < ApplicationRecord
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def time_passed_since_last_fetch?
 | 
					  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
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def show_totals_now?
 | 
					  def show_totals_now?
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user