From 70e0fc96fffae94b99df610d10a5fb40afc21ede Mon Sep 17 00:00:00 2001 From: Guilherme Amadio Date: Fri, 1 Nov 2024 11:48:53 +0100 Subject: [PATCH] [Python] Use values from the environment for add_job defaults Fixes: #1657 --- bindings/python/libs/client/copyprocess.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bindings/python/libs/client/copyprocess.py b/bindings/python/libs/client/copyprocess.py index e934dc4ac90..6d4a1ff0f7f 100644 --- a/bindings/python/libs/client/copyprocess.py +++ b/bindings/python/libs/client/copyprocess.py @@ -26,6 +26,7 @@ from pyxrootd import client from XRootD.client.url import URL from XRootD.client.responses import XRootDStatus +from .env import EnvGetInt, EnvGetString class ProgressHandlerWrapper(object): """Internal progress handler wrapper to convert parameters to friendly @@ -83,17 +84,17 @@ def add_job(self, checksumtype = '', checksumpreset = '', dynamicsource = False, - chunksize = 8388608, - parallelchunks = 4, - inittimeout = 600, - tpctimeout = 1800, + chunksize = EnvGetInt('CPChunkSize'), + parallelchunks = EnvGetInt('CPParallelChunks'), + inittimeout = EnvGetInt('CPInitTimeout'), + tpctimeout = EnvGetInt('CPTPCTimeout'), rmBadCksum = False, - cptimeout = 0, - xrateThreshold = 0, + cptimeout = EnvGetInt('CPTimeout'), + xrateThreshold = EnvGetInt('XRateThreshold'), xrate = 0, - retry = 0, + retry = EnvGetInt('CpRetry'), cont = False, - rtrplc = "force" ): + rtrplc = EnvGetString('CpRetryPolicy') ): """Add a job to the copy process. :param source: original source URL