Merge branch 'fix/2336-mastoapi-ws-posts-dropping' into 'develop'

Fix mastoapi ws posts dropping

Closes #2336

See merge request pleroma/pleroma!3198
This commit is contained in:
lain 2020-12-16 11:35:45 +00:00
commit 8b8c317c0f
15 changed files with 47 additions and 28 deletions

View file

@ -48,9 +48,15 @@ defmodule Mix.Tasks.Pleroma.Database do
def run(["update_users_following_followers_counts"]) do
start_pleroma()
User
|> Repo.all()
|> Enum.each(&User.update_follower_count/1)
Repo.transaction(
fn ->
from(u in User, select: u)
|> Repo.stream()
|> Stream.each(&User.update_follower_count/1)
|> Stream.run()
end,
timeout: :infinity
)
end
def run(["prune_objects" | args]) do