Skip to content

Commit

Permalink
Seems #348 wasn't fully fixed: avoid throwing exceptions for now
Browse files Browse the repository at this point in the history
  • Loading branch information
haf committed Jun 13, 2018
1 parent 0d59135 commit 5107b16
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 5.0.0-beta.18
* Ref #348 — wait for buffers - don't throw exceptions; push fix till later

#### 5.0.0-beta.17
* Fix #348 — wait for buffers

Expand Down
8 changes: 5 additions & 3 deletions examples/Libryy/LoggingV4.fs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ module Logger =
| Result.Error Rejected ->
Job.result ()
| Result.Error (BufferFull target) ->
Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target))
//Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target))
Job.result ()

/// Special case: e.g. Fatal messages.
let logAck (logger: Logger) level messageFactory: Promise<unit> =
Expand All @@ -411,8 +412,9 @@ module Logger =
| Result.Error Rejected ->
IVar.fill ack ()
| Result.Error (BufferFull target) ->
let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)
IVar.fillFailure ack e
//let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)
//IVar.fillFailure ack e
IVar.fill ack ()
start inner
ack :> Promise<_>

Expand Down
8 changes: 5 additions & 3 deletions src/Logary.Facade/Facade.fs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ module Logger =
| Result.Error Rejected ->
Job.result ()
| Result.Error (BufferFull target) ->
Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target))
//Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target))
Job.result ()

/// Special case: e.g. Fatal messages.
let logAck (logger: Logger) level messageFactory: Promise<unit> =
Expand All @@ -411,8 +412,9 @@ module Logger =
| Result.Error Rejected ->
IVar.fill ack ()
| Result.Error (BufferFull target) ->
let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)
IVar.fillFailure ack e
//let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)
//IVar.fillFailure ack e
IVar.fill ack ()
start inner
ack :> Promise<_>

Expand Down
8 changes: 5 additions & 3 deletions src/Logary/LoggerModule.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ module Logger =
| Result.Error Rejected ->
Job.result ()
| Result.Error (BufferFull target) ->
Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target))
//Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target))
Job.result ()

/// Special case: e.g. Fatal messages.
let logAck (logger: Logger) level messageFactory: Promise<unit> =
Expand All @@ -51,8 +52,9 @@ module Logger =
| Result.Error Rejected ->
IVar.fill ack ()
| Result.Error (BufferFull target) ->
let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)
IVar.fillFailure ack e
//let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)
//IVar.fillFailure ack e
IVar.fill ack ()
start inner
ack :> Promise<_>

Expand Down

0 comments on commit 5107b16

Please sign in to comment.