Skip to content

Commit 359eb6f

Browse files
test os._exit(0)
1 parent 8380b53 commit 359eb6f

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

src/opengeodeweb_viewer/rpc/utils_protocols.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Standard library imports
22
import os
3-
import time
3+
4+
# Third party imports
5+
from wslink import register as exportRpc # type: ignore
6+
7+
# Local application imports
8+
from opengeodeweb_microservice.schemas import get_schemas_dict
9+
from opengeodeweb_viewer.vtk_protocol import VtkView
10+
11+
12+
class VtkUtilsView(VtkView):
13+
utils_prefix = "opengeodeweb_viewer."
14+
utils_schemas_dict = get_schemas_dict(
15+
os.path.join(os.path.dirname(__file__), "schemas")
16+
)
17+
18+
def __init__(self) -> None:
19+
super().__init__()
20+
21+
@exportRpc(utils_prefix + utils_schemas_dict["kill"]["rpc"])
22+
# Standard library imports
23+
import os
424

525
# Third party imports
626
from wslink import register as exportRpc # type: ignore
@@ -21,7 +41,6 @@ def __init__(self) -> None:
2141

2242
@exportRpc(utils_prefix + utils_schemas_dict["kill"]["rpc"])
2343
def kill(self) -> None:
44+
print(f"{self.utils_prefix + self.utils_schemas_dict['kill']['rpc']}", flush=True)
2445
print("Manual viewer kill, shutting down...", flush=True)
25-
self.publish("kill", "Viewer killed")
26-
time.sleep(5)
2746
os._exit(0)

0 commit comments

Comments
 (0)