diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-05-05 20:38:10 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-05-05 20:38:10 +0200 |
commit | 04f6ece99ef15d0e0ced330e3945307499b7a715 (patch) | |
tree | 4febfe5d02e533603f922e8bb55dd3f5c24af6b8 /lib | |
parent | 7752f103f65f9c596f1571e31bed152382e2eacd (diff) | |
download | pleroma-04f6ece99ef15d0e0ced330e3945307499b7a715.tar.gz |
Send salmons and websub in background tasks.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/salmon/salmon.ex | 6 | ||||
-rw-r--r-- | lib/pleroma/web/websub/websub.ex | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/pleroma/web/salmon/salmon.ex b/lib/pleroma/web/salmon/salmon.ex index b95ad48ad..b4f81b4ed 100644 --- a/lib/pleroma/web/salmon/salmon.ex +++ b/lib/pleroma/web/salmon/salmon.ex @@ -150,8 +150,10 @@ defmodule Pleroma.Web.Salmon do remote_users(activity) |> Enum.each(fn(remote_user) -> - Logger.debug(fn -> "sending salmon to #{remote_user.ap_id}" end) - send_to_user(remote_user, feed, poster) + 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 diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index 7bdb778ad..a5abc303c 100644 --- a/lib/pleroma/web/websub/websub.ex +++ b/lib/pleroma/web/websub/websub.ex @@ -51,10 +51,12 @@ defmodule Pleroma.Web.Websub do signature = sign(sub.secret || "", response) Logger.debug(fn -> "Pushing to #{sub.callback}" end) - @httpoison.post(sub.callback, response, [ - {"Content-Type", "application/atom+xml"}, - {"X-Hub-Signature", "sha1=#{signature}"} - ]) + Task.start(fn -> + @httpoison.post(sub.callback, response, [ + {"Content-Type", "application/atom+xml"}, + {"X-Hub-Signature", "sha1=#{signature}"} + ]) + end) end) end |