Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(cli): set default num_part is None
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Aug 8, 2019
1 parent 6d3d2b4 commit f80e8c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gnes/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gnes/service/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gnes/service/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit f80e8c0

Please sign in to comment.