summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-12-16 11:35:45 +0000
committerlain <lain@soykaf.club>2020-12-16 11:35:45 +0000
commit8b8c317c0ff1534d3296369ba315b8919e8dc55c (patch)
treea5de91eecea4b6cd62a96d800ed714e50c649959 /lib
parent6bb4f4e1721d30762978b59a1aed11137223c183 (diff)
parentc37f78d1c87b0554b29213ab77f484747fa48f88 (diff)
downloadpleroma-8b8c317c0ff1534d3296369ba315b8919e8dc55c.tar.gz
pleroma-8b8c317c0ff1534d3296369ba315b8919e8dc55c.zip
Merge branch 'fix/2336-mastoapi-ws-posts-dropping' into 'develop'
Fix mastoapi ws posts dropping Closes #2336 See merge request pleroma/pleroma!3198
Diffstat (limited to 'lib')
-rw-r--r--lib/mix/pleroma.ex16
-rw-r--r--lib/mix/tasks/pleroma/database.ex12
-rw-r--r--lib/pleroma/emails/user_email.ex4
-rw-r--r--lib/pleroma/web/feed/feed_view.ex2
-rw-r--r--lib/pleroma/web/templates/email/digest.html.eex2
5 files changed, 27 insertions, 9 deletions
diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex
index 7575f0ef8..a33a9951c 100644
--- a/lib/mix/pleroma.ex
+++ b/lib/mix/pleroma.ex
@@ -12,7 +12,8 @@ defmodule Mix.Pleroma do
:cachex,
:flake_id,
:swoosh,
- :timex
+ :timex,
+ :fast_html
]
@cachex_children ["object", "user", "scrubber", "web_resp"]
@doc "Common functions to be reused in mix tasks"
@@ -37,12 +38,23 @@ defmodule Mix.Pleroma do
Enum.each(apps, &Application.ensure_all_started/1)
+ oban_config = [
+ crontab: [],
+ repo: Pleroma.Repo,
+ log: false,
+ queues: [],
+ plugins: []
+ ]
+
children =
[
Pleroma.Repo,
+ Pleroma.Emoji,
{Pleroma.Config.TransferTask, false},
Pleroma.Web.Endpoint,
- {Oban, Pleroma.Config.get(Oban)}
+ {Oban, oban_config},
+ {Majic.Pool,
+ [name: Pleroma.MajicPool, pool_size: Pleroma.Config.get([:majic_pool, :size], 2)]}
] ++
http_children(adapter)
diff --git a/lib/mix/tasks/pleroma/database.ex b/lib/mix/tasks/pleroma/database.ex
index a01c36ece..22151ce08 100644
--- a/lib/mix/tasks/pleroma/database.ex
+++ b/lib/mix/tasks/pleroma/database.ex
@@ -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
diff --git a/lib/pleroma/emails/user_email.ex b/lib/pleroma/emails/user_email.ex
index 806a61fd2..e6829b862 100644
--- a/lib/pleroma/emails/user_email.ex
+++ b/lib/pleroma/emails/user_email.ex
@@ -151,7 +151,7 @@ defmodule Pleroma.Emails.UserEmail do
logo_path =
if is_nil(logo) do
- Path.join(:code.priv_dir(:pleroma), "static/static/logo.png")
+ Path.join(:code.priv_dir(:pleroma), "static/static/logo.svg")
else
Path.join(Config.get([:instance, :static_dir]), logo)
end
@@ -162,7 +162,7 @@ defmodule Pleroma.Emails.UserEmail do
|> subject("Your digest from #{instance_name()}")
|> put_layout(false)
|> render_body("digest.html", html_data)
- |> attachment(Swoosh.Attachment.new(logo_path, filename: "logo.png", type: :inline))
+ |> attachment(Swoosh.Attachment.new(logo_path, filename: "logo.svg", type: :inline))
end
end
diff --git a/lib/pleroma/web/feed/feed_view.ex b/lib/pleroma/web/feed/feed_view.ex
index 56c024617..30e0a2a55 100644
--- a/lib/pleroma/web/feed/feed_view.ex
+++ b/lib/pleroma/web/feed/feed_view.ex
@@ -51,7 +51,7 @@ defmodule Pleroma.Web.Feed.FeedView do
def feed_logo do
case Pleroma.Config.get([:feed, :logo]) do
nil ->
- "#{Pleroma.Web.base_url()}/static/logo.png"
+ "#{Pleroma.Web.base_url()}/static/logo.svg"
logo ->
"#{Pleroma.Web.base_url()}#{logo}"
diff --git a/lib/pleroma/web/templates/email/digest.html.eex b/lib/pleroma/web/templates/email/digest.html.eex
index 860df5f9c..60eceff22 100644
--- a/lib/pleroma/web/templates/email/digest.html.eex
+++ b/lib/pleroma/web/templates/email/digest.html.eex
@@ -126,7 +126,7 @@
<div align="center" class="img-container center"
style="padding-right: 0px;padding-left: 0px;">
<!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr style="line-height:0px"><td style="padding-right: 0px;padding-left: 0px;" align="center"><![endif]--><img
- align="center" alt="Image" border="0" class="center" src="cid:logo.png"
+ align="center" alt="Image" border="0" class="center" src="cid:logo.svg"
style="text-decoration: none; -ms-interpolation-mode: bicubic; border: 0; height: 80px; width: auto; max-height: 80px; display: block;"
title="Image" height="80" />
<!--[if mso]></td></tr></table><![endif]-->