Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
preserve errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Oct 9, 2017
1 parent 0e269c0 commit 0a311d2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
5 changes: 5 additions & 0 deletions localassetmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
'use strict';

function getLocalItem(serverId, itemId) {

console.log('[lcoalassetmanager] Begin getLocalItem');

return itemrepository.get(serverId, itemId);
}

Expand Down Expand Up @@ -397,6 +400,8 @@

function createLocalItem(libraryItem, serverInfo, jobItem) {

console.log('[lcoalassetmanager] Begin createLocalItem');

var path = getDirectoryPath(libraryItem, serverInfo);
var localFolder = filerepository.getFullLocalPath(path);

Expand Down
4 changes: 2 additions & 2 deletions sync/localsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
isSyncing = null;
resolve();

}, function () {
}, function (err) {

isSyncing = null;
reject();
reject(err);
});
});

Expand Down
6 changes: 5 additions & 1 deletion sync/multiserversync.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@

new ServerSync().sync(connectionManager, server, options).then(function () {

console.log("ServerSync succeeded to server: " + server.Id);

syncNext(connectionManager, servers, index + 1, options, resolve, reject);

}, function () {
}, function (err) {

console.log("ServerSync failed to server: " + server.Id + '. ' + err);

syncNext(connectionManager, servers, index + 1, options, resolve, reject);
});
Expand Down
13 changes: 2 additions & 11 deletions sync/serversync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,14 @@
uploadPhotos = false;
}

var pr = Promise.resolve();
var promise = uploadPhotos ? uploadContent(connectionManager, server, options) : Promise.resolve();

return pr.then(function () {

if (uploadPhotos) {
return uploadContent(connectionManager, server, options);
}

return Promise.resolve();

}).then(function () {
return promise.then(function () {

return syncMedia(connectionManager, server, options);
});
}


function uploadContent(connectionManager, server, options) {

return new Promise(function (resolve, reject) {
Expand Down

0 comments on commit 0a311d2

Please sign in to comment.