projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d8d99fd
)
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
lain
<lain@soykaf.club>
Wed, 27 May 2020 07:46:12 +0000
(09:46 +0200)
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 0fe71694a6b5bff29494a0e34f93601e0676e332..b8a2873d84b7a568fa0bec2237ede6a535164f25 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub.ex
@@
-1158,7
+1158,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,