Skip to content

Commit

Permalink
fix function so objects have always the correct class
Browse files Browse the repository at this point in the history
  • Loading branch information
fmalmeida committed Mar 3, 2024
1 parent 4169227 commit e9c7d6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ process {
// a maximum limit
def check_max(obj, type) {
if(type == 'memory'){
obj = obj as nextflow.util.MemoryUnit
try {
if(obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1)
return params.max_memory as nextflow.util.MemoryUnit
Expand All @@ -74,6 +75,7 @@ def check_max(obj, type) {
return obj
}
} else if(type == 'time'){
obj = obj as nextflow.util.Duration
try {
if(obj.compareTo(params.max_time as nextflow.util.Duration) == 1)
return params.max_time as nextflow.util.Duration
Expand All @@ -84,6 +86,7 @@ def check_max(obj, type) {
return obj
}
} else if(type == 'cpus'){
obj = obj as int
try {
return Math.min( obj, params.max_cpus as int )
} catch (all) {
Expand Down

0 comments on commit e9c7d6a

Please sign in to comment.