Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed Jun 29, 2024
1 parent 408d367 commit 988a562
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ pygeoweaver/__pycache__/server.cpython-39.pyc
pygeoweaver/__pycache__/utils.cpython-39.pyc
.coverage
*.pyc
.DS_Store
nohup.out
15 changes: 8 additions & 7 deletions pygeoweaver/server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import socket
import subprocess
import sys
import webbrowser
import time
import requests
Expand Down Expand Up @@ -46,7 +47,7 @@ def start_on_windows():
java_cmd = os.path.join(jdk_home, "bin", "java.exe")
if not os.path.exists(java_cmd):
print("Java command not found.")
exit(1)
sys.exit(1)

print("Start Geoweaver..")
geoweaver_jar = os.path.join(home_dir, "geoweaver.jar")
Expand All @@ -72,13 +73,13 @@ def start_on_windows():
with open(log_file, "r") as f:
print(f.read())
print("Success: Geoweaver is up")
exit(0)
sys.exit(0)
except Exception as e:
# print(f"Error occurred during request: {e}")
continue

print("Error: Geoweaver is not up")
exit(1)
sys.exit(1)


def stop_on_windows():
Expand Down Expand Up @@ -116,7 +117,7 @@ def start_on_mac_linux():

if java_path is None:
print("Java not found. Exiting...")
exit(1)
sys.exit(1)

# Start Geoweaver
print("Start Geoweaver..")
Expand Down Expand Up @@ -149,10 +150,10 @@ def start_on_mac_linux():

if counter == max_counter:
print("Error: Geoweaver is not up")
exit(1)
sys.exit(1)
else:
print("Success: Geoweaver is up")
exit(0)
sys.exit(0)


def stop_on_mac_linux() -> int:
Expand Down Expand Up @@ -199,7 +200,7 @@ def stop():
# cwd=f"{get_root_dir()}/",
# shell=True,
# )
exit(stop_on_mac_linux())
sys.exit(stop_on_mac_linux())


def show(geoweaver_url=GEOWEAVER_DEFAULT_ENDPOINT_URL):
Expand Down

0 comments on commit 988a562

Please sign in to comment.