From: Anthony Geay Date: Tue, 13 Jun 2023 08:00:53 +0000 (+0200) Subject: when SALOME_BIG_OBJ_ON_DISK_THRES is -1 desactivate proxy mecanism X-Git-Tag: emc2p_1.4.0-rc1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8e3ea0a267f8611c16d61047a23468946a953463;p=modules%2Fkernel.git when SALOME_BIG_OBJ_ON_DISK_THRES is -1 desactivate proxy mecanism --- diff --git a/src/Container/SALOME_PyNode.py b/src/Container/SALOME_PyNode.py index dfc5467e8..06555527c 100644 --- a/src/Container/SALOME_PyNode.py +++ b/src/Container/SALOME_PyNode.py @@ -167,6 +167,13 @@ def GetBigObjectOnDiskThreshold(): else: return SALOME_BIG_OBJ_ON_DISK_THRES_DFT +def ActivateProxyMecanismOrNot( sizeInByte ): + thres = GetBigObjectOnDiskThreshold() + if thres == -1: + return False + else: + return sizeInByte > thres + def GetBigObjectDirectory(): import os if SALOME_FILE_BIG_OBJ_DIR not in os.environ: @@ -292,7 +299,7 @@ class BigObjectOnDiskTuple(BigObjectOnDiskSequence): def SpoolPickleObject( obj ): import pickle pickleObjInit = pickle.dumps( obj , pickle.HIGHEST_PROTOCOL ) - if len(pickleObjInit) < GetBigObjectOnDiskThreshold(): + if not ActivateProxyMecanismOrNot( len(pickleObjInit) ): return pickleObjInit else: if isinstance( obj, list):