We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcdd78b commit 544c29eCopy full SHA for 544c29e
lib/net/ldap/instrumentation.rb
@@ -6,10 +6,12 @@ module Net::LDAP::Instrumentation
6
#
7
# Returns the return value of the block.
8
def instrument(event, payload = {})
9
- return yield(payload) unless instrumentation_service
10
-
11
- instrumentation_service.instrument(event, payload) do |payload|
12
- payload[:result] = yield(payload)
+ if instrumentation_service
+ instrumentation_service.instrument(event, payload) do |payload|
+ payload[:result] = yield(payload) if block_given?
+ end
13
+ else
14
+ yield(payload) if block_given?
15
end
16
17
private :instrument
0 commit comments