perf: Make fetching user details lazy

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-02-15 13:11:33 +01:00
parent ea8b7999f7
commit 81c0d96357
7 changed files with 40 additions and 33 deletions

View File

@@ -119,7 +119,7 @@ class CardService {
public function enrichCards($cards) {
$user = $this->userManager->get($this->currentUser);
$cardIds = array_map(function (Card $card) {
$cardIds = array_map(function (Card $card) use ($user) {
// Everything done in here might be heavy as it is executed for every card
$cardId = $card->getId();
$this->cardMapper->mapOwner($card);