diff --git a/libCore.js b/libCore.js index 5eb6deb..8c72b0c 100644 --- a/libCore.js +++ b/libCore.js @@ -140,7 +140,7 @@ exports.updateFeeds = (client) => { if (!sendResults) { log.ERROR("No sending results from sending a post: ", sendResults, existingRecord, post); - return recordReject(); + return recordReject("No sending results from sending a post"); } log.DEBUG("Saving post to database: ", sendResults, post.title, source.channel_id); @@ -150,7 +150,7 @@ exports.updateFeeds = (client) => { if (saveResults) { log.DEBUG("Saved results: ", saveResults); - return recordResolve(); + return recordResolve("Saved results", saveResults); } }); }) @@ -165,7 +165,7 @@ exports.updateFeeds = (client) => { } Promise.all(recordPromiseArray).then((values) => { log.DEBUG("All posts finished for: ", source.title, values); - return resolve(); + return resolve(source.title); }); }); })) @@ -174,9 +174,8 @@ exports.updateFeeds = (client) => { // Wait for all connections to finish then close the temp connections Promise.all(sourcePromiseArray).then((values) => { - log.DEBUG("Closing temp connections: ", values); - tempFeedStorage.closeConnection(); - tempPostStorage.closeConnection(); + log.DEBUG("All sources finished, closing temp connections: ", values); + tempConnection.end(); }); }); }