From 702ac00b850620815f5f74b677ade50b44db800d Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 22 Dec 2016 16:30:25 +0530 Subject: [PATCH] Github issue #593, Increase timeout when posting topics / comments to message service -- Done. But not tested yet. Not sure how to validate that axios is actually respecting the new timeout. There are few issues mentioned in web community about axios not respecting the timeout settings in some cases. --- src/api/messages.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/messages.js b/src/api/messages.js index 7e0aff8e0..c4149a07d 100644 --- a/src/api/messages.js +++ b/src/api/messages.js @@ -45,7 +45,7 @@ export function getTopicPosts(topicId, postIds) { } export function createTopic(topicProps) { - return axios.post(`${TC_API_URL}/v4/topics/`, topicProps) + return axios.post(`${TC_API_URL}/v4/topics/`, topicProps, { timeout: 1.5 * 60 * 1000 }) .then( resp => { return _.get(resp.data, 'result.content', {}) }) @@ -54,7 +54,7 @@ export function createTopic(topicProps) { // ignore resp /*eslint-disable no-unused-vars */ export function addTopicPost(topicId, post) { - return axios.post(`${TC_API_URL}/v4/topics/${topicId}/posts`, { post: post.content } ) + return axios.post(`${TC_API_URL}/v4/topics/${topicId}/posts`, { post: post.content }, { timeout: 1.5 * 60 * 1000 } ) .then( resp => { return { topicId,