Skip to content

Commit

Permalink
add loop to keep python alive when server is up
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Mar 21, 2022
1 parent 6342ff9 commit 7c003ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pyhdx/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import time
from ipaddress import ip_address
from pyhdx.web import serve
from pyhdx.config import cfg
Expand Down Expand Up @@ -39,6 +40,14 @@ def main():
if args.serve:
serve.run_apps()

loop = True
while loop:
try:
time.sleep(1)
except KeyboardInterrupt:
print("Interrupted")
loop = False


if __name__ == "__main__":
import sys
Expand Down

0 comments on commit 7c003ca

Please sign in to comment.