diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2016-06-13 03:20:57 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2016-06-26 07:21:01 +0300 |
commit | 2476b74dbec83da02cfc88349461b0406e8405a7 (patch) | |
tree | 8d1c17ec4c801c08f8e9f58d287adf5c783f10d5 /app/workers | |
parent | dee8bc6f0e955d76055bf0ab4b7a07c0fccd8b37 (diff) |
refactoring delete from services
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/deferred_retraction.rb | 5 | ||||
-rw-r--r-- | app/workers/delete_post_from_service.rb | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/app/workers/deferred_retraction.rb b/app/workers/deferred_retraction.rb index 7c1425f4f..43675f5e8 100644 --- a/app/workers/deferred_retraction.rb +++ b/app/workers/deferred_retraction.rb @@ -6,12 +6,13 @@ module Workers class DeferredRetraction < Base sidekiq_options queue: :dispatch - def perform(user_id, retraction_data, recipient_ids) + def perform(user_id, retraction_data, recipient_ids, opts) user = User.find(user_id) subscribers = Person.where(id: recipient_ids) object = Retraction.new(retraction_data.deep_symbolize_keys, subscribers) + opts = HashWithIndifferentAccess.new(opts) - Diaspora::Federation::Dispatcher.build(user, object).dispatch + Diaspora::Federation::Dispatcher.build(user, object, opts).dispatch end end end diff --git a/app/workers/delete_post_from_service.rb b/app/workers/delete_post_from_service.rb index 9efd3bb18..6ea36c4fc 100644 --- a/app/workers/delete_post_from_service.rb +++ b/app/workers/delete_post_from_service.rb @@ -6,10 +6,10 @@ module Workers class DeletePostFromService < Base sidekiq_options queue: :http_service - def perform(service_id, post_id) + def perform(service_id, opts) service = Service.find_by_id(service_id) - post = Post.find_by_id(post_id) - service.delete_post(post) + opts = HashWithIndifferentAccess.new(opts) + service.delete_from_service(opts) end end end |