Skip to content

Commit 7c003ca

Browse files
committed
add loop to keep python alive when server is up
1 parent 6342ff9 commit 7c003ca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pyhdx/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import argparse
2+
import time
23
from ipaddress import ip_address
34
from pyhdx.web import serve
45
from pyhdx.config import cfg
@@ -39,6 +40,14 @@ def main():
3940
if args.serve:
4041
serve.run_apps()
4142

43+
loop = True
44+
while loop:
45+
try:
46+
time.sleep(1)
47+
except KeyboardInterrupt:
48+
print("Interrupted")
49+
loop = False
50+
4251

4352
if __name__ == "__main__":
4453
import sys

0 commit comments

Comments
 (0)