Skip to content

Commit af5a654

Browse files
v1.0.415
[Bot] push changes from Files.com
1 parent 517c95a commit af5a654

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.414
1+
1.0.415

lib/Api.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ var _fetchWithTimeout = function _fetchWithTimeout(url) {
2828
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
2929
timeoutSecs = _ref.timeoutSecs,
3030
options = (0, _objectWithoutProperties2.default)(_ref, _excluded);
31+
var timeoutId;
3132
return timeoutSecs <= 0 ? (0, _crossFetch.default)(url, options) : Promise.race([(0, _crossFetch.default)(url, options), new Promise(function (_, reject) {
32-
setTimeout(function () {
33+
timeoutId = setTimeout(function () {
3334
return reject(new errors.FilesError('Request timed out'));
3435
}, timeoutSecs * 1000);
35-
})]);
36+
})]).finally(function () {
37+
return clearTimeout(timeoutId);
38+
});
3639
};
3740
var fetchWithRetry = /*#__PURE__*/function () {
3841
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url, options) {

lib/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1';
1111
var apiKey;
1212
var baseUrl = 'https://app.files.com';
1313
var sessionId = null;
14-
var version = "1.0.414";
14+
var version = "1.0.415";
1515
var userAgent = "Files.com JavaScript SDK v".concat(version);
1616
var logLevel = _Logger.LogLevel.INFO;
1717
var debugRequest = false;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "files.com",
3-
"version": "1.0.414",
3+
"version": "1.0.415",
44
"description": "Files.com SDK for JavaScript",
55
"keywords": [
66
"files.com",

src/Api.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ import * as errors from './Errors'
55
import Logger from './Logger'
66
import { isEmpty, isObject } from './utils'
77

8-
const _fetchWithTimeout = (url, { timeoutSecs, ...options } = {}) =>
9-
timeoutSecs <= 0
8+
const _fetchWithTimeout = (url, { timeoutSecs, ...options } = {}) => {
9+
let timeoutId
10+
return timeoutSecs <= 0
1011
? fetch(url, options)
1112
: Promise.race([
1213
fetch(url, options),
1314
new Promise((_, reject) => {
14-
setTimeout(() => reject(new errors.FilesError('Request timed out')), timeoutSecs * 1000)
15+
timeoutId = setTimeout(() => reject(new errors.FilesError('Request timed out')), timeoutSecs * 1000)
1516
})
16-
])
17+
]).finally(() => clearTimeout(timeoutId))
18+
}
1719

1820
const fetchWithRetry = async (url, options, retries = 0) => {
1921
const maxRetries = Files.getMaxNetworkRetries()

src/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const endpointPrefix = '/api/rest/v1'
55
let apiKey
66
let baseUrl = 'https://app.files.com'
77
let sessionId = null
8-
let version = "1.0.414"
8+
let version = "1.0.415"
99
let userAgent = `Files.com JavaScript SDK v${version}`
1010

1111
let logLevel = LogLevel.INFO

0 commit comments

Comments
 (0)