Ensure we only expire Create activities with the Mix task

This commit is contained in:
Mark Felder 2020-08-08 12:40:52 -05:00
parent 2e7c5fe2de
commit cf4c97242b

View file

@ -136,6 +136,7 @@ def run(["ensure_expiration"]) do
|> join(:left, [a], u in assoc(a, :expiration)) |> join(:left, [a], u in assoc(a, :expiration))
|> where(local: true) |> where(local: true)
|> where([a, u], is_nil(u)) |> where([a, u], is_nil(u))
|> where([a], fragment("(? ->> 'type'::text) = 'Create'", a.data))
|> Pleroma.RepoStreamer.chunk_stream(100) |> Pleroma.RepoStreamer.chunk_stream(100)
|> Stream.each(fn activities -> |> Stream.each(fn activities ->
Enum.each(activities, fn activity -> Enum.each(activities, fn activity ->