sync-request icon indicating copy to clipboard operation
sync-request copied to clipboard

How to make "timeout" take effect

Open xiaonuo915 opened this issue 6 years ago • 1 comments

I use "sync-request" at node.js. I need to use a sync request for some reason. Requests may be interrupted due to network fluctuations. I tried to add a timeout to the sync-request configuration item, but it didn't take effect. this is code:

		let res = syncRequest('GET', url, {
			timeout: 5000,
			socketTimeout: 5000,
			maxRetries: 1,
			retryDelay: 10
		});
		let result = res.getBody("utf8");

Is this what is the reason?

xiaonuo915 avatar Aug 26 '19 03:08 xiaonuo915

+1

quanru avatar Mar 18 '20 14:03 quanru