Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove automatic restarting on exception #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions widowx_envs/widowx_envs/widowx_env_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
import argparse
import numpy as np
import logging
import traceback

from typing import Optional, Tuple, Any
from widowx_envs.utils.exceptions import Environment_Exception

# install from: https://github.com/youliangtan/edgeml
from edgeml.action import ActionClient, ActionServer, ActionConfig
from edgeml.internal.utils import mat_to_jpeg, jpeg_to_mat, compute_hash
from edgeml.internal.utils import mat_to_jpeg, jpeg_to_mat

##############################################################################

Expand Down Expand Up @@ -338,20 +337,7 @@ def main():

if args.server:
widowx_server = WidowXActionServer(port=args.port, testing=args.test)

# try capture errors and hard restart the server
while True:
try:
# this is a blocking call
widowx_server.start()
except Exception as e:
if e == KeyboardInterrupt:
break
print(traceback.format_exc())
print_red(f"{e}, Restarting server...")
widowx_server.stop()
widowx_server.hard_reset()
widowx_server.stop()
widowx_server.start()

if args.client:
widowx_client = WidowXClient(host=args.ip, port=args.port)
Expand Down