diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-08-30 22:03:46 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-08-30 22:03:46 -0500 |
commit | 3b276d268f8e49b897f16f490c78a5a5880c6216 (patch) | |
tree | bcb653e975ab223cf8d048778ab113489bf67b6d /app/controllers/admin/domain_blocks_controller.rb | |
parent | 60c449e1d77c6e11ced796a7e088038d80137de6 (diff) |
use a scheduled task to batch domain policy changes + revert `29643fd6` to avoid accidentally dosing servers when multiple users block a domain
Diffstat (limited to 'app/controllers/admin/domain_blocks_controller.rb')
-rw-r--r-- | app/controllers/admin/domain_blocks_controller.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/admin/domain_blocks_controller.rb b/app/controllers/admin/domain_blocks_controller.rb index 587c2c8c2..593b91455 100644 --- a/app/controllers/admin/domain_blocks_controller.rb +++ b/app/controllers/admin/domain_blocks_controller.rb @@ -14,6 +14,7 @@ module Admin resource_params[:domain].strip! if resource_params[:domain].present? resource_params[:reason].strip! if resource_params[:reason].present? + resource_pararms[:processing] = true @domain_block = DomainBlock.new(resource_params) existing_domain_block = resource_params[:domain].present? ? DomainBlock.find_by(domain: resource_params[:domain].strip) : nil @@ -23,7 +24,6 @@ module Admin end if @domain_block.save - DomainBlockWorker.perform_async(@domain_block.id) log_action :create, @domain_block redirect_to admin_instance_path(id: @domain_block.domain, limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg') else @@ -46,11 +46,10 @@ module Admin def update return destroy unless resource_params[:undo].to_i.zero? resource_params[:reason].strip! if resource_params[:reason].present? + resource_pararms[:processing] = true authorize @domain_block, :update? @domain_block.update(resource_params.except(:domain, :undo)) - changed = @domain_block.changed if @domain_block.save - DomainBlockWorker.perform_async(@domain_block.id) if (changed & %w(severity force_sensitive reject_media reject_unknown)).any? log_action :update, @domain_block flash[:notice] = I18n.t('admin.domain_blocks.updated_msg') else |