Comparing version 1.0.2 to 1.0.3
@@ -7,4 +7,2 @@ #!/usr/bin/env node | ||
disco = new discovery('discovery-pp-sf.otenv.com', { logger: { log: function (log) {}, error: function (error) {}}}), | ||
InfiniteLoop = require('infinite-loop'), | ||
il = new InfiniteLoop(), | ||
program = require('commander'), | ||
@@ -16,7 +14,7 @@ pkg = require('./package.json'); | ||
.option('-s, --service <service>', 'Name of the service to bother') | ||
.option('-t, --times <times>', 'Number of times the service needs to be bothered') | ||
.option('-t, --time <time>', 'Number of seconds for which you want to bother the service') | ||
.parse(process.argv); | ||
var service = program.service || 'restaurant'; | ||
var times = program.times || 100; | ||
var time = program.time; | ||
@@ -29,3 +27,10 @@ disco.connect(function(err){ | ||
il.add(bother.go, disco, service).run(); | ||
var bothering = setInterval(function() {bother.start(disco, service)}, 10); | ||
if(time){ | ||
setTimeout(function(){ | ||
clearInterval(bothering); | ||
process.exit(0); | ||
}, time * 1000); | ||
} | ||
}); |
{ | ||
"name": "bother", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Availability check for announced services", | ||
@@ -29,3 +29,2 @@ "main": "bother-app.js", | ||
"commander": "2.6.0", | ||
"infinite-loop": "0.2.2", | ||
"ot-discovery": "0.2.2", | ||
@@ -32,0 +31,0 @@ "request": "2.53.0" |
@@ -15,3 +15,6 @@ # bother | ||
```shell | ||
bother --service <servicename> --times <numberoftimes> | ||
``` | ||
bother --service <servicename> --time <seconds> | ||
``` | ||
The **time** parameter is optional. If not specified, you will bother forever. Until of course you force the exit from keyboard. | ||
@@ -5,3 +5,3 @@ 'use strict'; | ||
exports.go = function(disco, service) { | ||
exports.start = function(disco, service) { | ||
var url = disco.find(service); | ||
@@ -8,0 +8,0 @@ request(url + '/service-status', function(error, response){ |
Sorry, the diff of this file is not supported yet
4211
3
14
32
20
+ Addedtldts@6.1.76(transitive)
+ Addedtldts-core@6.1.76(transitive)
- Removedinfinite-loop@0.2.2
- Removedinfinite-loop@0.2.2(transitive)
- Removedtldts@6.1.77(transitive)
- Removedtldts-core@6.1.77(transitive)