From 0542773bca804868c8e4b45fe08f6041cb1b5851 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 19 Dec 2016 09:12:00 +0100 Subject: Make unfavouriting async to prevent timeout errors from leaving orphaned records behind --- app/workers/unfavourite_worker.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/workers/unfavourite_worker.rb (limited to 'app/workers') diff --git a/app/workers/unfavourite_worker.rb b/app/workers/unfavourite_worker.rb new file mode 100644 index 000000000..a14c82d6f --- /dev/null +++ b/app/workers/unfavourite_worker.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class UnfavouriteWorker + include Sidekiq::Worker + + def perform(account_id, status_id) + UnfavouriteService.new.call(Account.find(account_id), Status.find(status_id)) + end +end -- cgit