diff --git a/src/App/Command/UpdatePageCachesCommand.php b/src/App/Command/UpdatePageCachesCommand.php index c247b68..698e3ca 100755 --- a/src/App/Command/UpdatePageCachesCommand.php +++ b/src/App/Command/UpdatePageCachesCommand.php @@ -52,11 +52,14 @@ class UpdatePageCachesCommand extends Command $this->createLock(); $teams = $this->teamService->listTeams(); foreach ($teams as $team) { - set_time_limit(30); - if (null !== $team->getFilterId()) { + if ($team->isKanbanEnabled() && null !== $team->getFilterId()) { + set_time_limit(30); $this->jiraCollectorService->getKanbanBoard($team->getId(), true); } - $this->jiraCollectorService->getTeamWatchedIssues($team->getId(), true); + if ($team->isWatchedEnabled()) { + set_time_limit(30); + $this->jiraCollectorService->getTeamWatchedIssues($team->getId(), true); + } } $this->releaseLock(); } diff --git a/src/App/Entity/WatchedIssue.php b/src/App/Entity/WatchedIssue.php index bad648c..91cbeed 100755 --- a/src/App/Entity/WatchedIssue.php +++ b/src/App/Entity/WatchedIssue.php @@ -66,7 +66,7 @@ class WatchedIssue implements \JsonSerializable * @param string $assignee * @return WatchedIssue */ - public function setAssignee(string $assignee): WatchedIssue + public function setAssignee(?string $assignee): WatchedIssue { $this->assignee = $assignee; return $this; @@ -84,7 +84,7 @@ class WatchedIssue implements \JsonSerializable * @param WatchedIssueComment $comment * @return WatchedIssue */ - public function setComment(WatchedIssueComment $comment): WatchedIssue + public function setComment(?WatchedIssueComment $comment): WatchedIssue { $this->comment = $comment; return $this; diff --git a/src/App/Service/JiraCollectorService.php b/src/App/Service/JiraCollectorService.php index 2c622b8..f2ece21 100755 --- a/src/App/Service/JiraCollectorService.php +++ b/src/App/Service/JiraCollectorService.php @@ -223,7 +223,9 @@ class JiraCollectorService * with JIRA jql at the moment. */ return array_filter($hydratedResult, function(WatchedIssue $issue) use ($members) { - return !in_array($issue->getComment()->getSignum(), $members); + return null !== $issue->getComment() + ? !in_array($issue->getComment()->getSignum(), $members) + : false; }); }