diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-31 01:25:10 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-31 01:25:10 -0500 |
commit | 80a81fe223415525811c0c3ef62b8853624e9a6a (patch) | |
tree | a5438b0d28dd9a872ad0223b2a130dee59ab92b7 /app/workers | |
parent | 964054b6dbabf119c9dea9cfa0b71011ace8df07 (diff) |
ability to add domain moderation notes, edit existing domain policies in-place, and process asynchronously
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/domain_block_worker.rb | 2 | ||||
-rw-r--r-- | app/workers/domain_unblock_worker.rb | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/app/workers/domain_block_worker.rb b/app/workers/domain_block_worker.rb index 884477829..4ae36d6d4 100644 --- a/app/workers/domain_block_worker.rb +++ b/app/workers/domain_block_worker.rb @@ -3,6 +3,8 @@ class DomainBlockWorker include Sidekiq::Worker + sidekiq_options unique: :until_executed + def perform(domain_block_id) BlockDomainService.new.call(DomainBlock.find(domain_block_id)) rescue ActiveRecord::RecordNotFound diff --git a/app/workers/domain_unblock_worker.rb b/app/workers/domain_unblock_worker.rb new file mode 100644 index 000000000..2dbf25ac7 --- /dev/null +++ b/app/workers/domain_unblock_worker.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class DomainUnblockWorker + include Sidekiq::Worker + + sidekiq_options unique: :until_executed + + def perform(domain_block_id) + UnblockDomainService.new.call(DomainBlock.find(domain_block_id)) + rescue ActiveRecord::RecordNotFound + true + end +end |