Skip to content

Commit

Permalink
add logs on onCancel handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Sizov committed May 3, 2024
1 parent 8fb39c4 commit 3d035fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class BlockchainRpc(
metrics?.nativeSubscribeRespMetric?.increment()
}.doOnComplete {
log.info("Subscription ${req.subscriptionId} completed")
}.doOnCancel {
log.info("Subscription ${req.subscriptionId} canceled")
}.doOnError {
t ->
log.info("Error ${t.message} in subscription ${req.subscriptionId}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ open class NativeSubscribe(
start(it, subscriptionId)
}
.map(this@NativeSubscribe::convertToProto)
.onErrorMap {
.doOnCancel {
log.warn("Subscription ${subscriptionId} cancelled")
}.onErrorMap {
convertToStatus(it, subscriptionId)
}
}
Expand Down

0 comments on commit 3d035fc

Please sign in to comment.