Skip to content

Commit

Permalink
fix terminate event error
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed May 15, 2019
1 parent 96b96cd commit 1677938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/bert_serving/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def close(self):
@zmqd.socket(zmq.PUSH)
def _send_close_signal(self, _, frontend):
frontend.connect('tcp://localhost:%d' % self.port)
frontend.send_multipart([b'', ServerCmd.terminate, b'', b''])
frontend.send_multipart([b'0', ServerCmd.terminate, b'0', b'0'])

@staticmethod
def shutdown(args):
Expand All @@ -103,7 +103,7 @@ def shutdown(args):
with ctx.socket(zmq.PUSH) as frontend:
try:
frontend.connect('tcp://%s:%d' % (args.ip, args.port))
frontend.send_multipart([b'', ServerCmd.terminate, b'', b''])
frontend.send_multipart([b'0', ServerCmd.terminate, b'0', b'0'])
print('shutdown signal sent to %d' % args.port)
except zmq.error.Again:
raise TimeoutError(
Expand Down

0 comments on commit 1677938

Please sign in to comment.