projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3687788
)
ActivityPub: Change ordering to `nulls last` in favorites query
author
lain
<lain@soykaf.club>
Wed, 27 May 2020 07:46:12 +0000
(09:46 +0200)
committer
rinpatch
<rinpatch@sdf.org>
Sun, 7 Jun 2020 22:19:57 +0000
(
01:19
+0300)
This makes it use our existing index and speeds up the query.
lib/pleroma/web/activity_pub/activity_pub.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/activity_pub/activity_pub.ex
b/lib/pleroma/web/activity_pub/activity_pub.ex
index c4f83f9e1a3cc8cd2e087db4c5020391f4586382..5ce91a8d32088628303342b671a6b315f2f0f4e2 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub.ex
@@
-1318,7
+1318,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
|> Activity.with_joined_object()
|> Object.with_joined_activity()
|> select([_like, object, activity], %{activity | object: object})
- |> order_by([like, _, _], desc: like.id)
+ |> order_by([like, _, _], desc
_nulls_last
: like.id)
|> Pagination.fetch_paginated(
Map.merge(params, %{"skip_order" => true}),
pagination,