Closed mirend2002 closed 2 years ago
Thank you @mirend2002 for the details, I assume that you are using node.js
, where the default timeout is 10 seconds. You can change the timeout when creating the InfluxDB instance with:
const timeout = 30_000 // 30 seconds
const influxDB = new InfluxDB({url, token, timeout})
thanks for the quick response. it worked.
since we can not provide the timeout limit "RequestTimedOutError: Request timed out" return from the system. this happens wen there is massive data load to process. In my case i try to get 15days power consumption data query out from the system.
public getCurrentStatInfoDAO( _nodeRegistryId: any, _startTimeStamp: any, _endTimeStamp: any, _timeGap: number ): IPromise<any[]> { const defer = Q.defer();
const start = now();
const _logger = Logger.getLogger('[CurrentStatDAO] ');
const end = now();
_logger.debug(
'Get influx current stat info execution [Start] ',
start.toFixed(3),
'ms, [End] ',
end.toFixed(3),
'ms, [Duration] ',
(end - start).toFixed(3),
'ms'
);
const queryApi = new InfluxDB({url, token}).getQueryApi(org);
}
Code works fine until its under 5 days.