Skip to content

Commit 9db17aa

Browse files
committed
add 8 second timeout to topUsers fetch function
1 parent f30f5a6 commit 9db17aa

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

components/leaderboard/LeaderBoard.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export const LeaderBoard: React.FC = () => {
2121
setIsError(false);
2222

2323
try {
24-
const response = await axios.get("/api/topUsers");
24+
const response = await axios.get("/api/topUsers", {
25+
timeout: 8000
26+
});
2527
setLeaderBoardData(response.data);
2628
} catch (error) {
2729
console.error("Failed to fetch leaderboard data:", error);
@@ -87,3 +89,4 @@ export const LeaderBoard: React.FC = () => {
8789
};
8890

8991

92+

0 commit comments

Comments
 (0)