mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-21 05:58:12 +02:00
fix(analytics): reduce sync to 2x/day, remove frontend polling for cleaner charts
This commit is contained in:
1 parent
a460255b93
commit
8b13748f13
2 files changed
+5
-6
No files matched your search
@@ -10,8 +10,8 @@ import { apiRequest } from '@/lib/queryClient';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
|
||||
/** Maximum staleness before triggering an auto-refresh (6 hours in ms). */
|
||||
const STALE_THRESHOLD_MS = 6 * 60 * 60 * 1000;
|
||||
/** Maximum staleness before triggering an auto-refresh (12 hours in ms). */
|
||||
const STALE_THRESHOLD_MS = 12 * 60 * 60 * 1000;
|
||||
|
||||
export function AnalyticsDashboard() {
|
||||
const [selectedPageId, setSelectedPageId] = useState<string | null>(null);
|
||||
@@ -40,7 +40,6 @@ export function AnalyticsDashboard() {
|
||||
const { data: history = [], isLoading: isLoadingHistory } = useQuery<any[]>({
|
||||
queryKey: [`/api/analytics/pages/${selectedPageId}/history`],
|
||||
enabled: !!selectedPageId,
|
||||
refetchInterval: 30_000, // Poll every 30 seconds
|
||||
});
|
||||
|
||||
// Refresh Mutation
|
||||
|
||||
Reference in new issue
Block a user