Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
10857326
Commit
10857326
authored
May 01, 2017
by
lain
Browse files
Don't commit nil values in object cache.
parent
3cb51827
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/object.ex
View file @
10857326
...
...
@@ -19,7 +19,14 @@ def get_cached_by_ap_id(ap_id) do
get_by_ap_id
(
ap_id
)
else
key
=
"object:
#{
ap_id
}
"
Cachex
.
get!
(
:user_cache
,
key
,
fallback:
fn
(
_
)
->
get_by_ap_id
(
ap_id
)
end
)
Cachex
.
get!
(
:user_cache
,
key
,
fallback:
fn
(
_
)
->
object
=
get_by_ap_id
(
ap_id
)
if
object
do
{
:commit
,
object
}
else
{
:ignore
,
object
}
end
end
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment