* handle possible null values
* only update caches for enabled services
This commit is contained in:
parent
66bc94037d
commit
15455f648e
@ -52,12 +52,15 @@ class UpdatePageCachesCommand extends Command
|
||||
$this->createLock();
|
||||
$teams = $this->teamService->listTeams();
|
||||
foreach ($teams as $team) {
|
||||
if ($team->isKanbanEnabled() && null !== $team->getFilterId()) {
|
||||
set_time_limit(30);
|
||||
if (null !== $team->getFilterId()) {
|
||||
$this->jiraCollectorService->getKanbanBoard($team->getId(), true);
|
||||
}
|
||||
if ($team->isWatchedEnabled()) {
|
||||
set_time_limit(30);
|
||||
$this->jiraCollectorService->getTeamWatchedIssues($team->getId(), true);
|
||||
}
|
||||
}
|
||||
$this->releaseLock();
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user