Change summary
lib/command.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Detailed changes
@@ -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))