Skip to content

Commit

Permalink
decrease the polling frequency of getGroupPinboardIds and `getItemC…
Browse files Browse the repository at this point in the history
…ounts` from 5s to 15s as they're quite expensive - this is a temporary measure that I'd like to replace with GraphQL subscriptions somehow, so they're realtime like everything else
  • Loading branch information
twrichards committed Apr 16, 2024
1 parent 8c4e6fb commit cb5ed8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/src/inline/inlineMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const InlineMode = ({
)
),
});
startPolling(5000);
startPolling(15000);
}
}, [workflowTitleElementLookup]);

Expand Down
4 changes: 2 additions & 2 deletions client/src/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const Panel = ({
Math.abs(boundedPositionTranslation.y) > window.innerHeight / 2;

const groupPinboardIdsQuery = useQuery(gqlGetGroupPinboardIds, {
pollInterval: 5000, // always poll this one, to ensure we get unread flags even when pinboard is not expanded
pollInterval: 15000, // always poll this one, to ensure we get unread flags even when pinboard is not expanded
});

const groupPinboardIdsWithClaimCounts: PinboardIdWithClaimCounts[] = useMemo(
Expand Down Expand Up @@ -173,7 +173,7 @@ export const Panel = ({
useEffect(() => {
if (isExpanded) {
pinboardDataQuery.refetch();
pinboardDataQuery.startPolling(5000);
pinboardDataQuery.startPolling(15000);
} else {
pinboardDataQuery.stopPolling();
}
Expand Down

0 comments on commit cb5ed8b

Please sign in to comment.