From 8a4e12980a23f7752f11f4fc8e511411ffd7c839 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 30 Mar 2022 11:21:16 -0500 Subject: [PATCH] Command.execution setter --- lib/command.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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))