Skip to content
Permalink
Browse files

fix(cli): set default num_part is None

  • Loading branch information...
hanxiao committed Aug 8, 2019
1 parent 6d3d2b4 commit f80e8c03a468e3e028832a02385e2327373e0c82
Showing with 3 additions and 3 deletions.
  1. +1 −1 gnes/cli/parser.py
  2. +1 −1 gnes/service/base.py
  3. +1 −1 gnes/service/router.py
@@ -185,7 +185,7 @@ def set_router_service_parser(parser=None):
if not parser:
parser = set_base_parser()
set_loadable_service_parser(parser)
parser.add_argument('--num_part', type=int, default=1,
parser.add_argument('--num_part', type=int, default=None,
help='explicitly set the number of parts of message')
parser.set_defaults(read_only=True)
return parser
@@ -436,7 +436,7 @@ def __init__(self, service_cls, args):
self.services.append(RouterService(_head_router))
self.services.append(RouterService(_tail_router))

for j in range(args.num_parallel):
for _ in range(args.num_parallel):
_args = copy.deepcopy(args)
_args.port_in = port_out
_args.port_out = port_in
@@ -32,7 +32,7 @@ def post_init(self):

def _is_msg_complete(self, msg: 'gnes_pb2.Message', num_req: int) -> bool:
return (num_req == msg.envelope.num_part[-1]) or \
(hasattr(self.args, 'num_part') and num_req == self.args.num_part)
(num_req == self.args.num_part)

@handler.register(NotImplementedError)
def _handler_default(self, msg: 'gnes_pb2.Message'):

0 comments on commit f80e8c0

Please sign in to comment.
You can’t perform that action at this time.