@nuclia/sync-agent
Advanced tools
Comparing version 1.2.20 to 1.2.21
@@ -144,3 +144,8 @@ "use strict"; | ||
payload = this.setMetadata(payload, metadata); | ||
return this.getKb().pipe((0, rxjs_1.switchMap)((kb) => kb.createOrUpdateResource(payload).pipe((0, rxjs_1.retry)(RETRY_CONFIG), (0, rxjs_1.delay)(500), // do not overload the server | ||
return this.getKb().pipe((0, rxjs_1.switchMap)((kb) => kb.hasResource(slug).pipe((0, rxjs_1.switchMap)((exists) => { | ||
if (exists) { | ||
delete payload.title; | ||
} | ||
return kb.createOrUpdateResource(payload); | ||
}), (0, rxjs_1.retry)(RETRY_CONFIG), (0, rxjs_1.delay)(500), // do not overload the server | ||
(0, rxjs_1.catchError)((error) => { | ||
@@ -147,0 +152,0 @@ console.log('createOrUpdateResource – error:', JSON.stringify(error)); |
{ | ||
"name": "@nuclia/sync-agent", | ||
"version": "1.2.20", | ||
"version": "1.2.21", | ||
"description": "This is a sync agent to synchronize user files from diferent sources to nuclia", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
189311
4415