diff --git a/server/package.json b/server/package.json index cf8907a..c7498ba 100644 --- a/server/package.json +++ b/server/package.json @@ -35,6 +35,7 @@ "@types/chunk": "^0.0.0", "aws-lambda": "^1.0.7", "aws-sdk": "^2.1187.0", + "axios": "^0.27.2", "body-parser": "^1.19.0", "chunk": "^0.0.3", "cors": "^2.8.5", diff --git a/server/src/fetching/anime.ts b/server/src/fetching/anime.ts index 23f13b5..941b54f 100644 --- a/server/src/fetching/anime.ts +++ b/server/src/fetching/anime.ts @@ -4,11 +4,14 @@ import { LocalDate, ZonedDateTime, ZoneOffset } from '@js-joda/core'; import { Anime as MarikaAnime, IAnimeFull, IAnimeStats } from '@shineiichijo/marika'; import { ratelimit, retry } from '../utils'; import { Contracts } from "wrongopinions-common"; +import { default as axios } from 'axios'; const marika = { anime: new MarikaAnime(), } +axios.defaults.timeout = 10 * 1000; // Avoid pointless waiting when https://github.com/jikan-me/jikan-rest/issues/269 occurs + export async function loadAnime(db: DB, queue: QueueDispatcher, id: number): Promise { console.log("Loading anime", id); let details: IAnimeFull;