Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/consul/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,16 @@ var process_records = function(branch, records, cb) {
exports.getLastProcessedRef = function(branch, cb) {
var key_name = create_key_name(branch, branch.name + '.ref', true);
consul.kv.get({'key': key_name, token: token}, function(err, item) {
if(err) {
logger.warn('Cannot connect to consul to get the last processed reference id. Retrying...');
setTimeout(
function() {
exports.getLastProcessedRef(branch,cb);
},5000
);
// end this "thread"
return;
}
/* istanbul ignore if */
if (err) return cb(err);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is useless and should be removed as there should not be an err at this point.

cb(null, item === undefined ? item : item.Value);
Expand Down