Remove global count methods.
In the previous commit, we removed the global count for our output. This commit removes the logic as the only places where it was used was in recalculating the cache and since the last commit, we do not use this value anymore [MAILPOET-4487]
This commit is contained in:
@@ -71,14 +71,6 @@ class SubscribersCountsController {
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getSegmentGlobalStatusStatisticsCount(SegmentEntity $segment): array {
|
||||
$result = $this->getCacheItem(TransientCache::SUBSCRIBERS_GLOBAL_STATUS_STATISTICS_COUNT_KEY, (int)$segment->getId())['item'] ?? null;
|
||||
if (!$result) {
|
||||
$result = $this->recalculateSegmentGlobalStatusStatisticsCache($segment);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getSegmentStatisticsCountById(int $segmentId): array {
|
||||
$result = $this->getCacheItem(TransientCache::SUBSCRIBERS_STATISTICS_COUNT_KEY, $segmentId)['item'] ?? null;
|
||||
if (!$result) {
|
||||
@@ -99,16 +91,6 @@ class SubscribersCountsController {
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function recalculateSegmentGlobalStatusStatisticsCache(SegmentEntity $segment): array {
|
||||
$result = $this->segmentSubscribersRepository->getSubscribersGlobalStatusStatisticsCount($segment);
|
||||
$this->setCacheItem(
|
||||
TransientCache::SUBSCRIBERS_GLOBAL_STATUS_STATISTICS_COUNT_KEY,
|
||||
$result,
|
||||
(int)$segment->getId()
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function recalculateSegmentStatisticsCache(SegmentEntity $segment): array {
|
||||
$result = $this->segmentSubscribersRepository->getSubscribersStatisticsCount($segment);
|
||||
$this->setCacheItem(
|
||||
@@ -151,11 +133,6 @@ class SubscribersCountsController {
|
||||
$this->transientCache->invalidateItem(TransientCache::SUBSCRIBERS_STATISTICS_COUNT_KEY, $id);
|
||||
}
|
||||
}
|
||||
foreach ($this->transientCache->getItems(TransientCache::SUBSCRIBERS_GLOBAL_STATUS_STATISTICS_COUNT_KEY) as $id => $item) {
|
||||
if (!in_array($id, $segmentIds)) {
|
||||
$this->transientCache->invalidateItem(TransientCache::SUBSCRIBERS_GLOBAL_STATUS_STATISTICS_COUNT_KEY, $id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user