Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/546/head
Maxence Lange 2019-05-29 21:40:51 -01:00
rodzic d7baae9735
commit 2dca0728e9
1 zmienionych plików z 13 dodań i 15 usunięć

Wyświetl plik

@ -30,6 +30,7 @@ declare(strict_types=1);
namespace OCA\Social\Db;
use daita\MySmallPhpTools\Exceptions\CacheItemNotFoundException;
use daita\MySmallPhpTools\Traits\TArrayTools;
use Doctrine\DBAL\Query\QueryBuilder;
use OCA\Social\Exceptions\InvalidResourceException;
@ -408,24 +409,21 @@ class StreamRequestBuilder extends CoreRequestBuilder {
} catch (InvalidResourceException $e) {
}
try {
$action = $this->parseStreamActionsLeftJoin($data);
if ($item->hasCache()) {
$cache = $item->getCache();
if ($cache->hasItem($action->getStreamId())) {
$cachedItem = $item->getCache()
->getItem($action->getStreamId());
$cachedObject = $cachedItem->getObject();
$cachedObject['action'] = $action;
$cachedItem->setContent(json_encode($cachedObject));
$cache->updateItem($cachedItem, false);
}
$action = $this->parseStreamActionsLeftJoin($data);
if ($item->hasCache()) {
$cache = $item->getCache();
try {
$cachedItem = $cache->getItem($action->getStreamId());
$cachedObject = $cachedItem->getObject();
$cachedObject['action'] = $action;
$cachedItem->setContent(json_encode($cachedObject));
$cache->updateItem($cachedItem, false);
} catch (CacheItemNotFoundException $e) {
}
$item->setAction($action);
} catch (InvalidResourceException $e) {
}
$item->setAction($action);
return $item;
}