RichMedia: Disable websockets backfill streaming in StatusView
This commit is contained in:
parent
678fe8a064
commit
5f55c9653c
1 changed files with 6 additions and 1 deletions
|
|
@ -28,7 +28,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
# This is a naive way to do this, just spawning a process per activity
|
||||
# to fetch the preview. However it should be fine considering
|
||||
# pagination is restricted to 40 activities at a time
|
||||
# Force disable Websockets streaming for backfill jobs,
|
||||
# otherwise old posts can show up on timelines.
|
||||
defp fetch_rich_media_for_activities(activities, opts) do
|
||||
opts = Map.put(opts, :stream, false)
|
||||
Enum.each(activities, fn activity ->
|
||||
Card.get_by_activity(activity, opts)
|
||||
end)
|
||||
|
|
@ -362,8 +365,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
|
||||
summary = object.data["summary"] || ""
|
||||
|
||||
# Force disable Websockets streaming for backfill jobs which the below call will create,
|
||||
# otherwise old posts can show up on timelines.
|
||||
card =
|
||||
case Card.get_by_activity(activity, opts) do
|
||||
case Card.get_by_activity(activity, Map.put(opts, :stream, false)) do
|
||||
%Card{} = result -> render("card.json", result)
|
||||
_ -> nil
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue