Skip to content

Commit

Permalink
Remove the timeout (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrvecera authored Dec 4, 2022
1 parent 4819fea commit e85d498
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions packages/web/src/components/reddit/reddit-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useState, useEffect } from "react";
import { Card, Tooltip, Typography } from "antd";
import { Loading } from "../loading";
import { useMediaQuery } from "react-responsive";
import config from "../../config";

const { Title } = Typography;

Expand All @@ -22,7 +21,7 @@ const RedditCard: React.FC<Props> = (size) => {
try {
const res = await fetch(
"https://www.reddit.com/r/CompanyOfHeroes/top.json?limit=50&t=week",
{ signal: AbortSignal.timeout(config.defaultTimeoutRequestMs) },
{},
);
const resData = await res.json();
const requiredData = resData?.data?.children
Expand Down
3 changes: 1 addition & 2 deletions packages/web/src/pages/ladders/leaderboards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import { doc, getDoc, getFirestore } from "firebase/firestore";
import { disabledDate, generateIconsForTitle } from "./components";
import { leaderboardsID } from "../../coh/coh2-api";
import { ConfigContext } from "../../config-context";
import config from "../../config";

const { Text } = Typography;

Expand Down Expand Up @@ -111,7 +110,7 @@ const Leaderboards = () => {
`${getAPIUrl(
userConfig,
)}getCOHLaddersHttpV2?leaderBoardID=${leaderboardID}&start=0`,
{ signal: AbortSignal.timeout(config.defaultTimeoutRequestMs) },
{},
);
const finalData = await response.json();
setData(finalData);
Expand Down
3 changes: 1 addition & 2 deletions packages/web/src/pages/live-matches/live-matches-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Link } from "react-router-dom";
import routes from "../../routes";
import { ColumnsType } from "antd/es/table";
import { ConfigContext } from "../../config-context";
import config from "../../config";
import { AlertBoxChina } from "../../components/alert-box-china";
import { Space } from "antd/es";

Expand Down Expand Up @@ -111,7 +110,7 @@ const LiveMatchesTable: React.FC<{
`${getAPIUrl(
userConfig,
)}getLiveGamesHttp?playerGroup=${playerGroup}&start=${startQuery}&count=${count}&sortOrder=${orderByQuery}&apiKey=c2sXe4zguRtYMBY`,
{ signal: AbortSignal.timeout(config.defaultTimeoutRequestMs) },
{},
);
if (!response.ok) {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/pages/players/player-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const PlayerCard = () => {
try {
const response = await fetch(
`${getAPIUrl(userConfig)}getPlayerCardEverythingHttp?steamid=${steamid}`,
{ signal: AbortSignal.timeout(config.defaultTimeoutRequestMs) },
{},
);
if (!response.ok) {
throw new Error(
Expand Down
2 changes: 0 additions & 2 deletions packages/web/src/pages/search/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import SearchCommanderCard from "./components/search-commander-card";
import SearchBulletinCard from "./components/search-bulletin-card";
import { getAPIUrl } from "../../utils/helpers";
import { ConfigContext } from "../../config-context";
import config from "../../config";
import { AlertBoxChina } from "../../components/alert-box-china";

type RelicProfileType = {
Expand Down Expand Up @@ -219,7 +218,6 @@ const CustomSearch: React.FC = () => {

try {
const response = await fetch(`${getAPIUrl(userConfig)}searchPlayers`, {
signal: AbortSignal.timeout(config.defaultTimeoutRequestMs),
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down

0 comments on commit e85d498

Please sign in to comment.