mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-14 03:24:04 +00:00
Some servers send empty lease_seconds requests...
This commit is contained in:
parent
703d9f3628
commit
aa20941416
|
@ -89,6 +89,11 @@ defmodule Pleroma.Web.Websub do
|
||||||
Repo.get_by(WebsubServerSubscription, topic: topic, callback: callback) || %WebsubServerSubscription{}
|
Repo.get_by(WebsubServerSubscription, topic: topic, callback: callback) || %WebsubServerSubscription{}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Temp hack for mastodon.
|
||||||
|
defp lease_time(%{"hub.lease_seconds" => ""}) do
|
||||||
|
{:ok, 60 * 60 * 24 * 3} # three days
|
||||||
|
end
|
||||||
|
|
||||||
defp lease_time(%{"hub.lease_seconds" => lease_seconds}) do
|
defp lease_time(%{"hub.lease_seconds" => lease_seconds}) do
|
||||||
{:ok, String.to_integer(lease_seconds)}
|
{:ok, String.to_integer(lease_seconds)}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue