diff --git a/lib/command.rb b/lib/command.rb index 4292d22bf62efc879a74e1f747523866cc7d8ac4..da8116293a5d5224716ca896190c790bb6a71df1 100644 --- a/lib/command.rb +++ b/lib/command.rb @@ -11,6 +11,10 @@ class Command Thread.current[:execution] end + def self.execution=(exe) + Thread.current[:execution] = exe + end + def self.reply(stanza=nil, &blk) execution.reply(stanza, &blk) end @@ -51,7 +55,7 @@ class Command def execute StatsD.increment("command", tags: ["node:#{iq.node}"]) EMPromise.resolve(nil).then { - Thread.current[:execution] = self + Command.execution = self sentry_hub catch_after(EMPromise.resolve(yield self)) }.catch(&method(:panic))