perf: No need to fetch boards every middleware call

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-02-15 10:02:03 +01:00
parent 7bfbbee6e8
commit ea8b7999f7

View File

@@ -62,9 +62,8 @@ class DefaultBoardService {
*/ */
public function checkFirstRun($userId): bool { public function checkFirstRun($userId): bool {
$firstRun = $this->config->getUserValue($userId, Application::APP_ID, 'firstRun', 'yes'); $firstRun = $this->config->getUserValue($userId, Application::APP_ID, 'firstRun', 'yes');
$userBoards = $this->boardMapper->findAllByUser($userId);
if ($firstRun === 'yes' && count($userBoards) === 0) { if ($firstRun === 'yes') {
try { try {
$this->config->setUserValue($userId, Application::APP_ID, 'firstRun', 'no'); $this->config->setUserValue($userId, Application::APP_ID, 'firstRun', 'no');
} catch (PreConditionNotMetException $e) { } catch (PreConditionNotMetException $e) {