From 4ec40762b2a6b2286b9ec34bfff5dc5d3efeebdc Mon Sep 17 00:00:00 2001
From: Wanting Niu <wanting.niu@ldas-pcdev4.ligo.caltech.edu>
Date: Tue, 21 Jun 2022 14:17:11 -0700
Subject: [PATCH] add max-duration to the DAG options only when max-duration is
 in config file

---
 gstlal-inspiral/python/dags/layers/inspiral.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gstlal-inspiral/python/dags/layers/inspiral.py b/gstlal-inspiral/python/dags/layers/inspiral.py
index b8eb8d35fa..98062129f1 100644
--- a/gstlal-inspiral/python/dags/layers/inspiral.py
+++ b/gstlal-inspiral/python/dags/layers/inspiral.py
@@ -121,8 +121,9 @@ def svd_bank_layer(config, dag, median_psd_cache, split_bank_cache=None):
 			Option("samples-max", svd_config.samples_max),
 			Option("svd-tolerance", svd_config.tolerance),
 			Option("autocorrelation-length", mchirp_to_ac_length(bin_mchirp)),
-			Option("max-duration", svd_config.max_duration),
 		]
+		if "max_duration" in svd_config:
+			arguments.append(Option("max-duration", svd_config.max_duration))
 		if "sample_rate" in svd_config:
 			arguments.append(Option("sample-rate", svd_config.sample_rate))
 
-- 
GitLab