Skip to content

Commit

Permalink
Make refresh interval a parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
chaseajen committed Dec 17, 2015
1 parent 3f9adab commit 3b93449
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var containerApiUrl = "https://dashboard.tutum.co/api/v1/container";
// Check args
var args = process.argv;
if (args.length < 6) {
console.error("Insufficient arguments. Usage: node program tutum_user tutum_api_token consul_host consul_port");
console.error("Insufficient arguments. Usage: node program tutum_user tutum_api_token consul_host consul_port refresh_interval_ms");
process.exit(1);
}

Expand All @@ -16,10 +16,11 @@ var user = args[2];
var token = args[3];
var consulHost = args[4];
var consulPort = args[5];
var interval = args[6];

// Start processing
console.info("starting tutum-registrator. Tutum info: (%s, %s). Consul info: (%s:%d)", user, token, consulHost, consulPort);
setInterval(run, 10000);
setInterval(run, interval);

function run() {
// Read stopped containers and deregister
Expand Down

0 comments on commit 3b93449

Please sign in to comment.