Skip to content

Commit cad01ca

Browse files
committed
fix bug for testing
1 parent 0094847 commit cad01ca

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/ansys/dyna/core/pre/dynasolution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ def __init__(self, hostname="localhost", port="50051", server_path=""):
9191
# os.environ["ANSYS_PYDYNA_PRE_SERVER_PATH"] = server_path
9292
if os.path.isdir(server_path):
9393
threadserver = ServerThread(1, port=port, ip=hostname, server_path=server_path)
94-
threadserver.run()
94+
# threadserver.run()
9595
# threadserver.setDaemon(True)
96-
# threadserver.start()
96+
threadserver.start()
9797
waittime = 0
9898
while not DynaSolution.grpc_local_server_on():
9999
sleep(5)

src/ansys/dyna/core/pre/launcher.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import socket
55
import subprocess
6+
import threading
67

78
from ansys.dyna.core.pre import LOG
89
from ansys.dyna.core.pre.misc import check_valid_ip, check_valid_port
@@ -91,14 +92,14 @@ def launch_grpc(port=DYNAPRE_DEFAULT_PORT, ip=LOCALHOST, server_path=None) -> tu
9192

9293
LOG.debug("the pre service starting in background.")
9394
process = subprocess.Popen("python kwserver.py", cwd=server_path, shell=True)
94-
# process.wait()
95+
process.wait()
9596
# while True:
9697
# pass
9798
return port
9899

99100

100-
# class ServerThread(threading.Thread):
101-
class ServerThread:
101+
class ServerThread(threading.Thread):
102+
# class ServerThread:
102103
"""Provides server thread properties.
103104
104105
Parameters
@@ -112,7 +113,7 @@ class ServerThread:
112113
"""
113114

114115
def __init__(self, threadID, port, ip, server_path):
115-
# threading.Thread.__init__(self)
116+
threading.Thread.__init__(self)
116117
self.threadID = threadID
117118
self.port = port
118119
self.ip = ip

0 commit comments

Comments
 (0)