handle empty last_fetch
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending approval
ci/woodpecker/pr/build-arm64 Pipeline is pending approval
ci/woodpecker/pr/docs Pipeline is pending approval
ci/woodpecker/pr/lint Pipeline is pending approval
ci/woodpecker/pr/test Pipeline is pending approval
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending approval
ci/woodpecker/pr/build-arm64 Pipeline is pending approval
ci/woodpecker/pr/docs Pipeline is pending approval
ci/woodpecker/pr/lint Pipeline is pending approval
ci/woodpecker/pr/test Pipeline is pending approval
This commit is contained in:
parent
ee1f8938fc
commit
e37ffa1b1f
2 changed files with 10 additions and 3 deletions
|
@ -211,14 +211,14 @@ defp log_fetch_error(id, error) do
|
|||
end
|
||||
|
||||
# if its already an activity, dont wrap
|
||||
defp prepare_activity_params(%{"object" => _ } = data), do: data
|
||||
defp prepare_activity_params(%{"object" => _} = data), do: data
|
||||
|
||||
defp prepare_activity_params(data) do
|
||||
%{
|
||||
"type" => "Create",
|
||||
# Should we seriously keep this attributedTo thing?
|
||||
"actor" => data["actor"] || data["attributedTo"],
|
||||
"object" => data,
|
||||
"object" => data
|
||||
}
|
||||
|> Maps.put_if_present("to", data["to"])
|
||||
|> Maps.put_if_present("cc", data["cc"])
|
||||
|
|
|
@ -1862,7 +1862,14 @@ def enqueue_outbox_fetches(
|
|||
%{outbox: outbox_address, last_outbox_fetch: last_fetch, local: false} = user
|
||||
) do
|
||||
with(
|
||||
last_fetch <- last_fetch.to_unix(),
|
||||
last_fetch <-
|
||||
if last_fetch == nil do
|
||||
0
|
||||
else
|
||||
last_fetch
|
||||
|> DateTime.from_iso8601()
|
||||
|> DateTime.to_unix()
|
||||
end,
|
||||
now <- DateTime.utc_now().to_unix(),
|
||||
# future => epoch stuff, let it pass
|
||||
# >60 secs in past => ok
|
||||
|
|
Loading…
Reference in a new issue