Skip to content

Commit

Permalink
Make extended timeout specific to /batch/{pk}/ GET requests (#479)
Browse files Browse the repository at this point in the history
* Make extended timeout specific to /batch/{pk}/ GET requests

And set default timeout back to previous value

* Relocate extended timeout to api.js

---------

Co-authored-by: Rebecca Drabenstott <rdrabens@cisco.com>
  • Loading branch information
rebecca-draben and Rebecca Drabenstott authored Jun 11, 2024
1 parent 424101e commit d80208b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/service/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const api = createApi({
},
}),
getBatch: builder.query({
query: ({ id }) => ({ url: `batch/${id}/`, method: 'get' }),
query: ({ id }) => ({ url: `batch/${id}/`, method: 'get', timeout: 30 * 1000 }),
providesTags: (result, _err, { id }) => {
const tags = [{ type: 'Batch', id }];
// TODO: Add petitions from this result to redux store
Expand Down
2 changes: 1 addition & 1 deletion src/service/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CSRF_COOKIE_NAME, CSRF_HEADER_KEY } from '../constants/authConstants';

const Axios = axios.create({
baseURL: `/petition/api/`,
timeout: 20 * 1000,
timeout: 5 * 1000,
withCredentials: true, // allow setting/passing cookies
xsrfCookieName: CSRF_COOKIE_NAME,
xsrfHeaderName: CSRF_HEADER_KEY,
Expand Down

0 comments on commit d80208b

Please sign in to comment.