You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this greate project!
Not an issue but strange question, we try to use KV as source for our nginx configuration, we use git2consul with expand_keys, all works like a charm, we use also custom script with long polling to consul KV to determine changes in KV branch (managed by git2consul) the problem is that when git2consul is starting to change KV after commit our script triggers on very first change and we get invalid nginx configuration, however after some seconds if I run it manually again - all is ok, because git2-consul has updated all needed keys. So the question is could I determine the moment when all changes done to query new proper configuration. I'm thinking of using .ref key that is created by git2consul in needed branch, but I wanted to clarify if it is updated after all changes are done?
Thanks!
Roman
The text was updated successfully, but these errors were encountered:
// First, check to see what the current ref is for this branch.
branch.getCurrentRef(function(err, ref) {
/* istanbul ignore if */
if (err) return cb("Failed to get current ref for branch " + branch.name + " due to " + err);
/**
* Given a set of records, process them and update the branch manager to the current ref if successful.
*/
var handle_records = function(err, records) {
/* istanbul ignore if */
if (err) return cb(err);
process_records(branch, records, function(errs) {
if (errs) {
return cb("Some consul updates failed:\n" + errs.join('\n'));
}
// Note: This is a bit dangerous. We only update most recent ref if all consul writes are successful.
// If there's a bug that causes a certain consul write to always fail, we will always create our diffs
// from the ref before that file was added.
exports.setLastProcessedRef(branch, ref, function(err) {
return cb(err);
});
});
};
Hello,
Thank you for this greate project!
Not an issue but strange question, we try to use KV as source for our nginx configuration, we use git2consul with expand_keys, all works like a charm, we use also custom script with long polling to consul KV to determine changes in KV branch (managed by git2consul) the problem is that when git2consul is starting to change KV after commit our script triggers on very first change and we get invalid nginx configuration, however after some seconds if I run it manually again - all is ok, because git2-consul has updated all needed keys. So the question is could I determine the moment when all changes done to query new proper configuration. I'm thinking of using .ref key that is created by git2consul in needed branch, but I wanted to clarify if it is updated after all changes are done?
Thanks!
Roman
The text was updated successfully, but these errors were encountered: