From 8e3ea0a267f8611c16d61047a23468946a953463 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 13 Jun 2023 10:00:53 +0200 Subject: [PATCH] when SALOME_BIG_OBJ_ON_DISK_THRES is -1 desactivate proxy mecanism --- src/Container/SALOME_PyNode.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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): -- 2.39.2