mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-23 01:35:28 +00:00
Send salmons and websub in background tasks.
This commit is contained in:
parent
7752f103f6
commit
04f6ece99e
|
@ -150,9 +150,11 @@ defmodule Pleroma.Web.Salmon do
|
|||
|
||||
remote_users(activity)
|
||||
|> Enum.each(fn(remote_user) ->
|
||||
Task.start(fn ->
|
||||
Logger.debug(fn -> "sending salmon to #{remote_user.ap_id}" end)
|
||||
send_to_user(remote_user, feed, poster)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -51,11 +51,13 @@ defmodule Pleroma.Web.Websub do
|
|||
signature = sign(sub.secret || "", response)
|
||||
Logger.debug(fn -> "Pushing to #{sub.callback}" end)
|
||||
|
||||
Task.start(fn ->
|
||||
@httpoison.post(sub.callback, response, [
|
||||
{"Content-Type", "application/atom+xml"},
|
||||
{"X-Hub-Signature", "sha1=#{signature}"}
|
||||
])
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
def sign(secret, doc) do
|
||||
|
|
Loading…
Reference in a new issue