Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/352/head
Maxence Lange 2019-01-18 15:53:58 -01:00
rodzic 5236dd4ae8
commit d207a22f33
2 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -82,7 +82,7 @@ return [
['name' => 'Local#globalActorAvatar', 'url' => '/api/v1/global/actor/avatar', 'verb' => 'GET'],
['name' => 'Local#globalAccountsSearch', 'url' => '/api/v1/global/accounts/search', 'verb' => 'GET'],
['name' => 'Local#documentsCache', 'url' => '/api/v1/documents/cache', 'verb' => 'POST'],
// ['name' => 'Local#documentsCache', 'url' => '/api/v1/documents/cache', 'verb' => 'POST'],
['name' => 'Queue#asyncWithToken', 'url' => CurlService::ASYNC_TOKEN, 'verb' => 'POST'],

Wyświetl plik

@ -143,12 +143,10 @@ class ActorService {
*/
private function cacheDocumentIfNeeded(Person $actor) {
if ($actor->gotIcon()) {
$icon = $actor->getIcon();
try {
$icon = $this->cacheDocumentsRequest->getBySource(
$actor->getIcon()
->getUrl()
);
$actor->setIcon($icon);
$cache = $this->cacheDocumentsRequest->getByUrl($icon->getUrl());
$actor->setIcon($cache);
} catch (CacheDocumentDoesNotExistException $e) {
$this->cacheDocumentsRequest->save($actor->getIcon());
}