Various runtime configuration fixes

This commit is contained in:
href 2018-11-16 21:35:08 +01:00
commit bcecdc3ab1
No known key found for this signature in database
GPG key ID: EE8296C1A152C325
9 changed files with 26 additions and 22 deletions

View file

@ -31,10 +31,12 @@ defmodule Pleroma.Object do
def normalize(ap_id) when is_binary(ap_id), do: Object.get_by_ap_id(ap_id)
def normalize(_), do: nil
def get_cached_by_ap_id(ap_id) do
if Mix.env() == :test do
if Mix.env() == :test do
def get_cached_by_ap_id(ap_id) do
get_by_ap_id(ap_id)
else
end
else
def get_cached_by_ap_id(ap_id) do
key = "object:#{ap_id}"
Cachex.fetch!(:object_cache, key, fn _ ->