File tree 1 file changed +8
-4
lines changed
src/runner/Synapse.Runner/Services/Executors
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,15 @@ protected override async Task DoExecuteAsync(CancellationToken cancellationToken
68
68
{
69
69
if ( this . Collection == null ) throw new InvalidOperationException ( "The executor must be initialized before execution" ) ;
70
70
var task = await this . Task . GetSubTasksAsync ( cancellationToken ) . OrderBy ( t => t . CreatedAt ) . LastOrDefaultAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
71
- var index = task == null ? 0 : int . Parse ( task . Reference . OriginalString . Split ( '/' , StringSplitOptions . RemoveEmptyEntries ) . Last ( ) ) ;
72
- if ( index == this . Collection . Count - 1 )
71
+ var index = 0 ;
72
+ if ( task != null )
73
73
{
74
- await this . SetResultAsync ( this . Task . Input , this . Task . Definition . Then , cancellationToken ) . ConfigureAwait ( false ) ;
75
- return ;
74
+ index = int . Parse ( task . Reference . OriginalString . Split ( '/' , StringSplitOptions . RemoveEmptyEntries ) . Last ( ) ) ;
75
+ if ( index == this . Collection . Count - 1 )
76
+ {
77
+ await this . SetResultAsync ( this . Task . Input , this . Task . Definition . Then , cancellationToken ) . ConfigureAwait ( false ) ;
78
+ return ;
79
+ }
76
80
}
77
81
var item = this . Collection . ElementAt ( index ) ;
78
82
var taskDefinition = new DoTaskDefinition ( )
You can’t perform that action at this time.
0 commit comments