Closed erdalsivri closed 4 years ago
Thank you for the report; submitted #46 with the fix :+1:
Heads-up, if you're maintaining a sink that depends upon this one, check out the newer non-subclassing API and PeriodicBatchingSinkOptions
- example's now in https://github.com/serilog/serilog-sinks-periodicbatching#getting-started
Cheers!
Thanks for the very fast fix!
PeriodicBatchingSink
has a constructor to specifyqueueLimit
, which has a documentation that says:However, setting
NoQueueLimit
, which is equal to-1
, doesn't work becauseBoundedConcurrentQueue
fails whenqueueLimit
is less than zero:PeriodicBatchingSink
should either make thequeueLimit
parameter nullable and changeNoQueueLimit
to be null or InitializePeriodicBatchingSinkOptions.QueueLimit
conditionally like this:Alternative is to fix
BoundedConcurrentQueue
to acceptBoundedConcurrentQueue.Unbounded
(-1
) as unlimited instead of failing the precondition check. This wouldn't be very nice because then there would be two ways of specifying unbounded:null
and-1
.