fix: double callback destroy
This commit is contained in:
parent
f92b61681a
commit
1debfab5ec
@ -160,6 +160,11 @@ class Channel::Whatsapp < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def teardown_webhooks
|
def teardown_webhooks
|
||||||
|
# NOTE: Guard against double execution during destruction due to the
|
||||||
|
# `has_one :inbox, dependent: :destroy` relationship which will trigger this callback circularly
|
||||||
|
return if @webhook_teardown_initiated
|
||||||
|
|
||||||
|
@webhook_teardown_initiated = true
|
||||||
Whatsapp::WebhookTeardownService.new(self).perform
|
Whatsapp::WebhookTeardownService.new(self).perform
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user