mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
refactor: create StatService
This commit is contained in:
@@ -5,7 +5,6 @@ namespace App\Entity;
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use App\Controller\StatisticsController;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
@@ -28,19 +27,6 @@ class Statistics
|
||||
private ?int $domainTracked = null;
|
||||
private ?int $domainCountTotal = null;
|
||||
|
||||
public static function updateRDAPQueriesStat(CacheItemPoolInterface $pool, string $key): bool
|
||||
{
|
||||
try {
|
||||
$item = $pool->getItem($key);
|
||||
$item->set(($item->get() ?? 0) + 1);
|
||||
|
||||
return $pool->save($item);
|
||||
} catch (\Throwable) {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getRdapQueries(): ?int
|
||||
{
|
||||
return $this->rdapQueries;
|
||||
|
||||
Reference in New Issue
Block a user