diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2013-03-12 16:48:09 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2013-03-12 16:48:09 +0100 |
commit | 367ef8140d560db270e5d8458eb986590f6f93ef (patch) | |
tree | 7e9b76b7fc80ef58d4288912ed95332cfc996331 | |
parent | dff49a9ced1bb67a58b4c95510b48627debb8e27 (diff) | |
download | lanes-367ef8140d560db270e5d8458eb986590f6f93ef.tar.gz lanes-367ef8140d560db270e5d8458eb986590f6f93ef.tar.bz2 lanes-367ef8140d560db270e5d8458eb986590f6f93ef.zip |
Update lanes.lua
fix validation of with_timers config option: validator was accepting any non-boolean value
-rw-r--r-- | src/lanes.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lanes.lua b/src/lanes.lua index 729116e..c1c641a 100644 --- a/src/lanes.lua +++ b/src/lanes.lua | |||
@@ -71,14 +71,18 @@ lanes.configure = function( _params) | |||
71 | end, | 71 | end, |
72 | with_timers = function( _val) | 72 | with_timers = function( _val) |
73 | -- with_timers may be nil or boolean | 73 | -- with_timers may be nil or boolean |
74 | return _val and type( _val) == "boolean" or true | 74 | if _val then |
75 | return type( _val) == "boolean" | ||
76 | else | ||
77 | return true -- _val is either false or nil | ||
78 | end | ||
75 | end, | 79 | end, |
76 | on_state_create = function( _val) | 80 | on_state_create = function( _val) |
77 | -- on_state_create may be nil or a function | 81 | -- on_state_create may be nil or a function |
78 | return _val and type( _val) == "function" or true | 82 | return _val and type( _val) == "function" or true |
79 | end, | 83 | end, |
80 | shutdown_timeout = function( _val) | 84 | shutdown_timeout = function( _val) |
81 | -- nb_keepers should be a number >= 0 | 85 | -- shutdown_timeout should be a number >= 0 |
82 | return type( _val) == "number" and _val >= 0 | 86 | return type( _val) == "number" and _val >= 0 |
83 | end, | 87 | end, |
84 | track_lanes = function( _val) | 88 | track_lanes = function( _val) |