@nuclia/sync-agent
Advanced tools
Comparing version 1.0.7 to 1.0.9
@@ -41,5 +41,11 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const response = yield fetch(url); | ||
// TODO: control whether it is zipped or plain | ||
return response.text(); | ||
try { | ||
const response = yield fetch(url); | ||
// TODO: control whether it is zipped or plain | ||
return response.text(); | ||
} | ||
catch (error) { | ||
console.error('Error fetching sitemap', error); | ||
return Promise.resolve(''); | ||
} | ||
}); | ||
@@ -46,0 +52,0 @@ } |
@@ -138,5 +138,6 @@ "use strict"; | ||
}) | ||
.pipe((0, rxjs_1.retry)(RETRY_CONFIG), (0, rxjs_1.catchError)((error) => { | ||
.pipe((0, rxjs_1.retry)(RETRY_CONFIG), (0, rxjs_1.delay)(500), // do not overload the server | ||
(0, rxjs_1.catchError)((error) => { | ||
console.log('createOrUpdateResource – error:', JSON.stringify(error)); | ||
return (0, rxjs_1.throwError)(() => new Error('Resource creation/modification failed')); | ||
return (0, rxjs_1.of)({ success: false, message: '' }); | ||
}))), (0, rxjs_1.map)(() => undefined)); | ||
@@ -143,0 +144,0 @@ } |
{ | ||
"name": "@nuclia/sync-agent", | ||
"version": "1.0.7", | ||
"version": "1.0.9", | ||
"description": "This is a sync agent to synchronize user files from diferent sources to nuclia", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
174945
4095