Skip to content

Commit

Permalink
Added: Fullsync every 8h
Browse files Browse the repository at this point in the history
  • Loading branch information
psi-4ward committed May 6, 2015
1 parent 14d4d4e commit 9ac0c2f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,18 @@ fs.readdirSync(__dirname + '/backends').forEach(function(file) {
backends.push(new Be(docker));
});

// Startup sync
docker.on('eventstream_open', function() {
console.log('Docker daemon connected');
// Sync
function sync() {
console.log('Sync etcd with running containers');
docker.getRunning(function(err, services) {
if(err) return errorLogger('sync', err);
_.invoke(backends, 'sync', services);
});
}
docker.on('eventstream_open', function() {
console.log('Docker daemon connected');
sync();
setInterval(sync, 3600 * 8 * 1000);
});


Expand Down

0 comments on commit 9ac0c2f

Please sign in to comment.