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
6a184115
Commit
6a184115
authored
Jun 23, 2017
by
lain
Browse files
Longer timeouts for outgoing federation.
parent
42633406
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/salmon/salmon.ex
View file @
6a184115
...
...
@@ -132,7 +132,7 @@ def remote_users(%{data: %{"to" => to}}) do
end
defp
send_to_user
(%{
info:
%{
"salmon"
=>
salmon
}},
feed
,
poster
)
do
poster
.
(
salmon
,
feed
,
[{
"Content-Type"
,
"application/magic-envelope+xml"
}])
poster
.
(
salmon
,
feed
,
[{
"Content-Type"
,
"application/magic-envelope+xml"
}]
,
timeout:
10000
,
recv_timeout:
20000
)
end
defp
send_to_user
(
_
,
_
,
_
),
do
:
nil
...
...
lib/pleroma/web/websub/websub.ex
View file @
6a184115
...
...
@@ -54,9 +54,9 @@ def publish(topic, user, activity) do
Task
.
start
(
fn
->
with
{
:ok
,
%{
status_code:
code
}}
<-
@httpoison
.
post
(
sub
.
callback
,
response
,
[
{
"Content-Type"
,
"application/atom+xml"
},
{
"X-Hub-Signature"
,
"sha1=
#{
signature
}
"
}
]
)
do
{
"Content-Type"
,
"application/atom+xml"
},
{
"X-Hub-Signature"
,
"sha1=
#{
signature
}
"
}
],
timeout:
10000
,
recv_timeout:
20000
)
do
Logger
.
debug
(
fn
->
"Pushed to
#{
sub
.
callback
}
, code
#{
code
}
"
end
)
else
e
->
Logger
.
debug
(
fn
->
"Couldn't push to
#{
sub
.
callback
}
,
#{
inspect
(
e
)
}
"
end
)
...
...
test/web/salmon/salmon_test.exs
View file @
6a184115
...
...
@@ -84,7 +84,7 @@ test "it pushes an activity to remote accounts it's addressed to" do
user
=
Repo
.
get_by
(
User
,
ap_id:
activity
.
data
[
"actor"
])
{
:ok
,
user
}
=
Pleroma
.
Web
.
WebFinger
.
ensure_keys_present
(
user
)
poster
=
fn
(
url
,
data
,
headers
)
->
poster
=
fn
(
url
,
data
,
headers
,
options
)
->
assert
url
==
"http://example.org/salmon"
end
Salmon
.
publish
(
user
,
activity
,
poster
)
...
...
Write
Preview
Markdown
is supported
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