Skip to content

Commit

Permalink
Reverted changes in combiner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhellander committed Jul 8, 2024
1 parent a707481 commit e9815a5
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions fedn/network/combiner/combiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

import fedn.network.grpc.fedn_pb2 as fedn
import fedn.network.grpc.fedn_pb2_grpc as rpc
from fedn.common.log_config import (logger, set_log_level_from_string,
set_log_stream)
from fedn.common.log_config import logger, set_log_level_from_string, set_log_stream
from fedn.network.combiner.connect import ConnectorCombiner, Status
from fedn.network.combiner.modelservice import ModelService
from fedn.network.combiner.roundhandler import RoundConfig, RoundHandler
Expand Down Expand Up @@ -702,20 +701,9 @@ def SendModelValidation(self, request, context):
def run(self):
"""Start the server."""
logger.info("COMBINER: {} started, ready for gRPC requests.".format(self.id))

def handle_signal(signum, frame):
logger.warning(f"Received signal {signum}, shutting down gracefully.")
self.server.stop(0) # Add a timeout if necessary
logger.warning("Server stopped.")
exit(0)

signal.signal(signal.SIGINT, handle_signal) # Handle Ctrl-C
signal.signal(signal.SIGTERM, handle_signal) # Handle Docker stop

# try:
logger.warning("STARTING UP")
while True:
signal.pause()
# except (KeyboardInterrupt, SystemExit):
# pass
try:
while True:
signal.pause()
except (KeyboardInterrupt, SystemExit):
pass
self.server.stop()

0 comments on commit e9815a5

Please sign in to comment.