From 31dd98ee9a4deb6115741e70770316bbfd49f662 Mon Sep 17 00:00:00 2001 From: Aaron Petkau Date: Thu, 25 Jan 2024 16:02:43 -0600 Subject: [PATCH] Added ability to limit network connections --- conf/modules.config | 4 ++++ nextflow.config | 13 ++++++++----- nextflow_schema.json | 6 ++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index c6ad44a..2d40329 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -25,4 +25,8 @@ process { pattern: '*_versions.yml' ] } + + withName: SRATOOLS_PREFETCH { + maxForks = params.max_jobs_with_network_connections + } } diff --git a/nextflow.config b/nextflow.config index 3d6f102..61db778 100644 --- a/nextflow.config +++ b/nextflow.config @@ -37,11 +37,14 @@ params { max_time = '1.h' // Schema validation default options - validationFailUnrecognisedParams = false - validationLenientMode = false - validationSchemaIgnoreParams = 'genomes,igenomes_base' - validationShowHiddenParams = false - validate_params = true + validationFailUnrecognisedParams = false + validationLenientMode = false + validationSchemaIgnoreParams = 'genomes,igenomes_base' + validationShowHiddenParams = false + validate_params = true + + // Options for limiting network activity + max_jobs_with_network_connections = 1 } // Load base.config by default for all pipelines diff --git a/nextflow_schema.json b/nextflow_schema.json index bb6905e..8a30502 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -190,6 +190,12 @@ "description": "Validation of parameters in lenient more.", "hidden": true, "help_text": "Allows string values that are parseable as numbers or booleans. For further information see [JSONSchema docs](https://github.com/everit-org/json-schema#lenient-mode)." + }, + "max_jobs_with_network_connections": { + "type": "integer", + "default": 1, + "description": "Maximum number of jobs with network connections allowed to run at once", + "hidden": true } } }