File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2222 if ( line != null && int . TryParse ( line , out var result ) )
2323 {
2424 var cts = new CancellationTokenSource ( ) ;
25-
25+ var messages = result / 3 ;
2626 var ct = cts . Token ;
2727 var connection = new NpgsqlConnection ( Settings . ConnectionString ) ;
2828 await using var connection1 = connection . ConfigureAwait ( false ) ;
3636 1 => new UserDeleted ( Guid . NewGuid ( ) ) ,
3737 _ => new UserModified ( Guid . NewGuid ( ) )
3838 } ) ;
39+ await Console . Out . WriteLineAsync ( $ "Publishing { messages + ( ( result % 3 > 0 ) ? 1 : 0 ) } { nameof ( UserCreated ) } ") ;
40+ await Console . Out . WriteLineAsync ( $ "Publishing { messages + ( ( result % 3 > 1 ) ? 1 : 0 ) } { nameof ( UserDeleted ) } ") ;
41+ await Console . Out . WriteLineAsync ( $ "Publishing { messages } { nameof ( UserModified ) } ") ;
3942 foreach ( var @event in @events )
4043 {
4144 var transaction = await connection . BeginTransactionAsync ( ct ) . ConfigureAwait ( false ) ;
6366 throw ;
6467 }
6568 }
69+ await Console . Out . WriteLineAsync ( $ "Published { result } messages!") ;
6670 }
6771 //use a batch command
6872 //{
You can’t perform that action at this time.
0 commit comments