Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
04f6ece9
Commit
04f6ece9
authored
May 05, 2017
by
lain
Browse files
Send salmons and websub in background tasks.
parent
7752f103
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/salmon/salmon.ex
View file @
04f6ece9
...
...
@@ -150,8 +150,10 @@ def publish(%{info: %{"keys" => keys}} = user, activity, poster) 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
...
...
lib/pleroma/web/websub/websub.ex
View file @
04f6ece9
...
...
@@ -51,10 +51,12 @@ def publish(topic, user, activity) 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment