Default #halt timeout is 3s, now user configurable

This commit is contained in:
Andrew Stewart 2014-09-03 15:39:54 -07:00
parent e840823092
commit 8f20ccbcf3
1 changed files with 3 additions and 2 deletions

View File

@ -105,8 +105,9 @@ Cylon.config = function(key) {
//
// Returns nothing
Cylon.halt = function halt(callback) {
// set a timeout, in case trying to shut everything down nicely doesn't work
Utils.after((1.5).seconds(), callback);
// if robots can't shut down quickly enough, forcefully self-terminate
var timeout = Config.halt_timeout || 3000
Utils.after(timeout, callback);
var fns = [];