Do not attempt to schedule poll refresh jobs for local activities
This commit is contained in:
parent
9ff57946e7
commit
0a42a3f2ea
2 changed files with 23 additions and 2 deletions
|
|
@ -34,8 +34,10 @@ defmodule Pleroma.Web.MastodonAPI.PollController do
|
|||
with %Object{} = object <- Object.get_by_id(id),
|
||||
%Activity{} = activity <- Activity.get_create_by_object_ap_id(object.data["id"]),
|
||||
true <- Visibility.visible_for_user?(activity, user) do
|
||||
PollWorker.new(%{"op" => "refresh", "activity_id" => activity.id})
|
||||
|> Oban.insert(unique: [period: 60])
|
||||
unless activity.local do
|
||||
PollWorker.new(%{"op" => "refresh", "activity_id" => activity.id})
|
||||
|> Oban.insert(unique: [period: 60])
|
||||
end
|
||||
|
||||
try_render(conn, "show.json", %{object: object, for: user})
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue