From 05bd04d68c301f7463d95dc8406adf85578120fc Mon Sep 17 00:00:00 2001 From: root <28149841+germa89@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:30:28 +0000 Subject: [PATCH] feat: adding early exit in flush_stored --- src/ansys/mapdl/core/mapdl_core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ansys/mapdl/core/mapdl_core.py b/src/ansys/mapdl/core/mapdl_core.py index a6033a83bb..1f99aaaf3a 100644 --- a/src/ansys/mapdl/core/mapdl_core.py +++ b/src/ansys/mapdl/core/mapdl_core.py @@ -1900,6 +1900,9 @@ def _flush_stored(self): Overridden by gRPC. """ + if not self._stored_commands: + return # Early exit in case it is empty + self._log.debug("Flushing stored commands") rnd_str = random_string() tmp_out = os.path.join(tempfile.gettempdir(), f"tmp_{rnd_str}.out")