request / request-promise

The simplified HTTP request client 'request' with Promise support. Powered by Bluebird.
ISC License
4.76k stars 297 forks source link

rejected promise not handled within 1 second #298

Closed Rolodo closed 5 years ago

Rolodo commented 5 years ago

I am using the lib in a vscode extension. I'm doing something like that :

import * as rp from 'request-promise';
//[...]
rp({method: "GET",
        uri:  <URL>,
        headers: {
            "Authorization": <OPTIONS.AUTENTIFICATION_TOKEN>,
            "User-Agent": <OPTIONS.USER_AGENT>,
            "Accept": <OPTIONS.CONTENT_TYPE>,
            "Content-Type": <OPTIONS.CONTENT_TYPE>,
        },
        body: {},
        json: true
    }).then(r => {
            //log
        }).catch(e => {
            //log
});
//[...]

so if I call it 3 time.

I've never created an extension for vscode... if someone can confirm if this is a bug from the lib or from vscode.

Thanks!

KR34T1V commented 5 years ago

Did you manage to solve this? I am having the same issue!

Rolodo commented 5 years ago

For me it seems that my logic was not good following callback ... I solved this be changing the order I was doing my call try adding async for all your call instead of doing the .then speculating ... (if this is a real bug?? could it be that the current request instance is not closed before the other are called ?)