]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
when SALOME_BIG_OBJ_ON_DISK_THRES is -1 desactivate proxy mecanism
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 13 Jun 2023 08:00:53 +0000 (10:00 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 22 Aug 2023 09:40:50 +0000 (11:40 +0200)
src/Container/SALOME_PyNode.py

index dfc5467e88b4886dc2371b7e5c301a719e372d6f..06555527c5ba0d626a89694e8d82d6c7d171aec6 100644 (file)
@@ -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):