git2consul
Advanced tools
Comparing version 0.6.3 to 0.6.4
@@ -115,3 +115,3 @@ var fs = require('fs'); | ||
busy = false; | ||
this_obj.busy = false; | ||
@@ -118,0 +118,0 @@ // Pass values to the original callback |
@@ -12,16 +12,13 @@ var _ = require('underscore'); | ||
// Track all active GitManager objects so we can traverse them as needed for a graceful shutdown. | ||
var repos = {}; | ||
var repos = exports.repos = {}; | ||
// End the process once we are sure that no branches are busy updating. | ||
exports.gracefulShutdown = function(cb) { | ||
for (var repo_name in repos) { | ||
var my_git_manager = repos[repo_name]; | ||
var branch_names = my_git_manager.getBranchNames(); | ||
for (var i=0; i<branch_names.length; ++i) { | ||
var branch_name = branch_names[i]; | ||
var my_branch_manager = my_git_manager.getBranchManager(branch_name); | ||
if (my_branch_manager && my_branch_manager.isBusy()) { | ||
logger.warn("Waiting for branch %s in repo %s", branch_name, my_git_manager.getRepoName()); | ||
for (var repo_name in repos) { | ||
var repo = repos[repo_name]; | ||
for (var i=0; i<repo.branch_names.length; ++i) { | ||
var branch_name = repo.branch_names[i]; | ||
var branch = repo.getBranch(branch_name); | ||
if (branch && branch.busy) { | ||
logger.warn("Waiting for branch %s in repo %s", branch.name, repo_name); | ||
setTimeout(function() { | ||
@@ -28,0 +25,0 @@ exports.gracefulShutdown(cb); |
{ | ||
"name": "git2consul", | ||
"description": "System for moving data from git to consul", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ { |
@@ -98,4 +98,8 @@ #### git2consul | ||
Coverage is run automatically by Travis and uploaded to coveralls.io. | ||
[![Coverage Status](https://img.shields.io/coveralls/Cimpress-MCP/git2consul.svg)](https://coveralls.io/r/Cimpress-MCP/git2consul?branch=master) | ||
##### License | ||
Apache 2.0 |
@@ -15,6 +15,6 @@ var should = require('should'); | ||
"path": "./test/logs/test.log" | ||
}/*,{ | ||
"level": "trace", | ||
},{ | ||
"level": "warn", | ||
"stream": "process.stdout" | ||
}*/] | ||
}] | ||
} | ||
@@ -21,0 +21,0 @@ }); |
@@ -23,4 +23,2 @@ var should = require('should'); | ||
// TODO: Fix this test. | ||
/** | ||
it ('should successfully fire if other stuff is happening', function(done) { | ||
@@ -40,5 +38,8 @@ | ||
var ref_change_handled = false; | ||
git_utils.repo.branches['master'].handleRefChange(0, function(err) { | ||
if (err) return done(err); | ||
shutdown_seen.should.equal(false); | ||
ref_change_handled = true; | ||
}); | ||
@@ -49,2 +50,3 @@ | ||
shutdown_seen = true; | ||
ref_change_handled.should.equal(true); | ||
done(); | ||
@@ -57,3 +59,2 @@ }); | ||
}); | ||
*/ | ||
@@ -60,0 +61,0 @@ after(function() { |
var fs = require('fs'); | ||
var git_commands = require('../../lib/git/commands.js'); | ||
var git = require('../../lib/git'); | ||
var Repo = require('../../lib/git/repo.js'); | ||
@@ -46,2 +47,3 @@ | ||
exports.repo = new Repo(repo_config); | ||
git.repos[repo_config.name] = exports.repo; | ||
exports.repo.init(function(err) { | ||
@@ -48,0 +50,0 @@ if (err) return cb(err); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
91118
2038
105
1