Skip to content

Commit 5c966f1

Browse files
committed
fix degrade of duplicate method selection
1 parent f1bd201 commit 5c966f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/MicroBatchFramework/BatchEngine.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public async Task RunAsync(Type type, string[] args)
6565
{
6666
if (args.Length > 0 && command.EqualsAny(args[0]))
6767
{
68-
// command alias is first priority(if duplicate with MethodName([Command("run")]Run()), okay to execute.
68+
// command's priority is first
6969
method = item;
7070
argsOffset = 1;
71-
continue;
71+
goto RUN;
7272
}
7373
else
7474
{
@@ -82,10 +82,10 @@ public async Task RunAsync(Type type, string[] args)
8282
{
8383
if (method != null)
8484
{
85-
await SetFailAsync(ctx, "Found duplicate method/command name, name or alias only allows unique name. Type:" + type.FullName + " Method:" + method.Name + " and " + item.Name);
85+
await SetFailAsync(ctx, "Found two public methods(wihtout command). Type:" + type.FullName + " Method:" + method.Name + " and " + item.Name);
8686
return;
8787
}
88-
method = item;
88+
method = item; // found single public(non-command) method.
8989
}
9090
}
9191

0 commit comments

Comments
 (0)