File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/Serilog.Sinks.MSSqlServer/Sinks/MSSqlServer Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ public class MSSqlServerSink : PeriodicBatchingSink
48
48
readonly DataTable _eventsTable ;
49
49
readonly IFormatProvider _formatProvider ;
50
50
readonly string _tableName ;
51
- readonly CancellationTokenSource _token = new CancellationTokenSource ( ) ;
52
51
private readonly ColumnOptions _columnOptions ;
53
52
54
53
private readonly HashSet < string > _additionalDataColumnNames ;
@@ -129,7 +128,7 @@ protected override async Task EmitBatchAsync(IEnumerable<LogEvent> events)
129
128
{
130
129
using ( var cn = new SqlConnection ( _connectionString ) )
131
130
{
132
- await cn . OpenAsync ( _token . Token ) . ConfigureAwait ( false ) ;
131
+ await cn . OpenAsync ( ) . ConfigureAwait ( false ) ;
133
132
using ( var copy = new SqlBulkCopy ( cn ) )
134
133
{
135
134
copy . DestinationTableName = _tableName ;
@@ -140,9 +139,8 @@ protected override async Task EmitBatchAsync(IEnumerable<LogEvent> events)
140
139
copy . ColumnMappings . Add ( mapping ) ;
141
140
}
142
141
143
- await copy . WriteToServerAsync ( _eventsTable , _token . Token ) . ConfigureAwait ( false ) ;
142
+ await copy . WriteToServerAsync ( _eventsTable ) . ConfigureAwait ( false ) ;
144
143
}
145
-
146
144
}
147
145
}
148
146
catch ( Exception ex )
@@ -393,8 +391,6 @@ protected override void Dispose(bool disposing)
393
391
_eventsTable . Dispose ( ) ;
394
392
395
393
base . Dispose ( disposing ) ;
396
-
397
- _token . Cancel ( ) ;
398
394
}
399
395
}
400
396
}
You can’t perform that action at this time.
0 commit comments