projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e857075
)
object: normalize(): use object cache
author
William Pitcock
<nenolod@dereferenced.org>
Sun, 25 Nov 2018 21:20:29 +0000
(21:20 +0000)
committer
William Pitcock
<nenolod@dereferenced.org>
Tue, 4 Dec 2018 04:52:09 +0000
(
04:52
+0000)
lib/pleroma/object.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/object.ex
b/lib/pleroma/object.ex
index 03a75dfbdbbcdcf00bbf9493b1c8cc9272868266..57a8b1d6b08f3664149314ab40c95ba67fd86151 100644
(file)
--- a/
lib/pleroma/object.ex
+++ b/
lib/pleroma/object.ex
@@
-27,8
+27,8
@@
defmodule Pleroma.Object do
Repo.one(from(object in Object, where: fragment("(?)->>'id' = ?", object.data, ^ap_id)))
end
- def normalize(obj) when is_map(obj), do:
Object.get_by_ap_id
(obj["id"])
- def normalize(ap_id) when is_binary(ap_id), do:
Object.get
_by_ap_id(ap_id)
+ def normalize(obj) when is_map(obj), do:
normalize
(obj["id"])
+ def normalize(ap_id) when is_binary(ap_id), do:
get_cached
_by_ap_id(ap_id)
def normalize(_), do: nil
if Mix.env() == :test do