profile
viewpoint

dejour/canvas-game 1

use canvas to make a game

dejour/lox 1

lox language

dejour/500lines 0

500 Lines or Less

dejour/angular2-seed 0

Modular seed project for Angular 2 apps with fast, statically typed build

dejour/awesome-react 0

A collection of awesome things regarding React ecosystem.

dejour/blog 0

personal blog

dejour/computer-science 0

:mortar_board: Path to a free self-taught graduation in Computer Science

issue openedaxios/axios

is it possible to set a timeout timer after the request is sent

Is your feature request related to a problem? Please describe. In our node app, we find out it has a similar issue with #1200. we set the timeout of axios to 200 ms. some timeout error was found in our log while the server endpoint response time was within 200ms

Describe the solution you'd like expect timeout error not happen. after looked the code.

// Handle request timeout
    if (config.timeout) {
      timer = setTimeout(function handleRequestTimeout() {
        req.abort();
        reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));
      }, config.timeout);
    }
   ....
    // Send the request
    if (utils.isStream(data)) {
      data.on('error', function handleStreamError(err) {
        reject(enhanceError(err, config, null, req));
      }).pipe(req);
    } else {
      req.end(data);
    }

I suspect that requests and timers are not activated in sync manner. maybe we can trigger timeout in the req.end callback or pipe finish callback.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

created time in a month

startedvuejs/vue-next

started time in 4 months

more