Skip to content
Extraits de code Groupes Projets
Valider a91c3ef6 rédigé par Eugen Rochko's avatar Eugen Rochko
Parcourir les fichiers

Delegate processing of incoming PuSH data to background workers

parent cea28e0c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -16,7 +16,7 @@ class Api::SubscriptionsController < ApiController
subscription = @account.subscription(api_subscription_url(@account.id))
if subscription.verify(body, request.headers['HTTP_X_HUB_SIGNATURE'])
ProcessFeedService.new.call(body, @account)
ProcessingWorker.perform_async(@account.id, body.force_encoding('UTF-8'))
head 201
else
head 202
......
class ProcessingWorker
include Sidekiq::Worker
def perform(account_id, body)
ProcessFeedService.new.call(body, Account.find(account_id))
end
end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter