Chunk the notification type backfill migration
Long-term we want that migration to be done entirely in SQL, but for now this is a hotfix to not cause OOMs on large databases. This is using a homegrown version of `Repo.stream`, it's worse in terms of performance than the upstream since it doesn't use the same prepared query for chunk queries, but unlike the upstream it supports preloads.
This commit is contained in:
parent
b536e57124
commit
5c0e1039ce
2 changed files with 29 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ defmodule Pleroma.MigrationHelper.NotificationBackfill do
|
|||
)
|
||||
|
||||
query
|
||||
|> Repo.all()
|
||||
|> Repo.chunk_stream(100)
|
||||
|> Enum.each(fn notification ->
|
||||
type =
|
||||
notification.activity
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue