From 7ccdc5acd25979c7c5e82f3d5f373a45be685175 Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Mon, 5 May 2025 10:48:14 -0400 Subject: [PATCH] Fix heartbeats in future from messing with active_user data --- app/jobs/cache/active_users_graph_data_job.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/jobs/cache/active_users_graph_data_job.rb b/app/jobs/cache/active_users_graph_data_job.rb index 36e9ad1..9cbc380 100644 --- a/app/jobs/cache/active_users_graph_data_job.rb +++ b/app/jobs/cache/active_users_graph_data_job.rb @@ -8,6 +8,7 @@ class Cache::ActiveUsersGraphDataJob < Cache::ActivityJob hours = Heartbeat.coding_only .with_valid_timestamps .where("time > ?", 24.hours.ago.to_f) + .where("time < ?", Time.current.to_f) .select("(EXTRACT(EPOCH FROM to_timestamp(time))::bigint / 3600 * 3600) as hour, COUNT(DISTINCT user_id) as count") .group("hour") .order("hour DESC")