Skip to content

Commit

Permalink
increase axios timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
rstijerina committed Feb 20, 2025
1 parent 96eb02e commit 0583f43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions client/src/hooks/datafiles/mutations/useUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Cookies from 'js-cookie';
import truncateMiddle from 'utils/truncateMiddle';
import { useMutation } from '@tanstack/react-query';

apiClient.defaults.timeout = 5 * 60 * 1000; // 5 minutes

export async function uploadUtil({
api,
scheme,
Expand Down
2 changes: 1 addition & 1 deletion client/src/utils/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios, { AxiosError } from 'axios';
export type TApiError = AxiosError<{ message?: string }>;

export const apiClient = axios.create({
timeout: 30000,
timeout: 60 * 1000, // 1 minute
xsrfHeaderName: 'X-CSRFToken',
xsrfCookieName: 'csrftoken',
});

0 comments on commit 0583f43

Please sign in to comment.