From 0b949a42e4a5bc30d02da3e52bd101a0243fc6cb Mon Sep 17 00:00:00 2001 From: jim hollenbach Date: Thu, 25 May 2023 19:23:01 -0700 Subject: [PATCH] prevent exponentially multiplying setIntervals on pending build cards (#4061) --- enterprise/app/history/history_invocation_card.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/enterprise/app/history/history_invocation_card.tsx b/enterprise/app/history/history_invocation_card.tsx index f13cb0091e3..be7e0f178ec 100644 --- a/enterprise/app/history/history_invocation_card.tsx +++ b/enterprise/app/history/history_invocation_card.tsx @@ -49,10 +49,17 @@ export default class HistoryInvocationCardComponent extends React.Component this.updateTimeIfInProgress(), durationRefreshIntervalMillis); + if (!this.interval) { + this.interval = window.setInterval(() => { + this.updateTimeIfInProgress(); + }, durationRefreshIntervalMillis); + } } componentWillUnmount() {