Skip to content

Commit dffc673

Browse files
authored
fix(settings): Prevent infinite requests in forward stats (#104032)
Date.now() updates every time component is rendered, making a new request. The request still currently fails.
1 parent 8bc754d commit dffc673

File tree

1 file changed

+2
-2
lines changed
  • static/app/views/settings/projectDataForwarding

1 file changed

+2
-2
lines changed

static/app/views/settings/projectDataForwarding/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Fragment} from 'react';
1+
import {Fragment, useState} from 'react';
22

33
import {hasEveryAccess} from 'sentry/components/acl/access';
44
import Feature from 'sentry/components/acl/feature';
@@ -33,7 +33,7 @@ type DataForwardingStatsProps = {
3333
};
3434

3535
function DataForwardingStats({organization, project}: DataForwardingStatsProps) {
36-
const until = Math.floor(Date.now() / 1000);
36+
const [until] = useState(() => Math.floor(Date.now() / 1000));
3737
const since = until - 3600 * 24 * 30;
3838
const options = {
3939
query: {

0 commit comments

Comments
 (0)