Skip to content

Commit 2fc1011

Browse files
committed
converting to int
1 parent 036214a commit 2fc1011

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

commands/utils/set_args.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,11 @@ function sync_args_from_cmd(args) {
435435
}
436436

437437
if ("max_duration" in args) {
438-
lt_config["run_settings"]["max_duration"] = parseFloat(args["max_duration"]);
438+
lt_config["run_settings"]["max_duration"] = parseInt(args["max_duration"]);
439+
} else {
440+
lt_config["run_settings"]["max_duration"] = parseInt(
441+
lt_config["run_settings"]["max_duration"]
442+
);
439443
}
440444

441445
//get specs from current directory if specs are not passed in config or cli

commands/utils/validate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ module.exports = validate_config = function (lt_config, validation_configs) {
5757
if (!(max_duration == undefined ||
5858
max_duration == null ||
5959
isNaN(max_duration))) {
60-
if (parseFloat(max_duration) <2 || parseFloat(max_duration) > 240){
60+
if (Number(parallels) && Number(parallels) % 1 !== 0){
61+
reject("Error!! max_duration should be and Integer between 2 and 240 minutes");
62+
}else if (parseInt(max_duration) <2 || parseInt(max_duration) > 240){
6163
reject("Error!! max_duration should be between 2 and 240 minutes");
6264
}
6365
}

0 commit comments

Comments
 (0)