Skip to content

Commit

Permalink
Fix param naming in check_max function
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianMohr committed Jul 26, 2023
1 parent 96082bb commit 8ab5c4e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -108,29 +108,29 @@ params.manifest = manifest
def check_max(obj, type) {
if (type == 'memory') {
try {
if (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1)
return params.max_memory as nextflow.util.MemoryUnit
if (obj.compareTo(params.memory as nextflow.util.MemoryUnit) == 1)
return params.memory as nextflow.util.MemoryUnit
else
return obj
} catch (all) {
println " ### ERROR ### Max memory '${params.max_memory}' is not valid! Using default value: $obj"
println " ### ERROR ### Max memory '${params.memory}' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'time') {
try {
if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1)
return params.max_time as nextflow.util.Duration
if (obj.compareTo(params.time as nextflow.util.Duration) == 1)
return params.time as nextflow.util.Duration
else
return obj
} catch (all) {
println " ### ERROR ### Max time '${params.max_time}' is not valid! Using default value: $obj"
println " ### ERROR ### Max time '${params.time}' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'cpus') {
try {
return Math.min( obj, params.max_cpus as int )
return Math.min( obj, params.cpus as int )
} catch (all) {
println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj"
println " ### ERROR ### Max cpus '${params.cpus}' is not valid! Using default value: $obj"
return obj
}
}
Expand Down

0 comments on commit 8ab5c4e

Please sign in to comment.