From 5415844ccfe54f88bf8303f57a71189e7ef23c8b 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 7045ce8ca..071cdbe8b 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