month = $month; $this->site = $site; } /** * Execute the job. */ public function handle(): void { $currentMonth = date('Ym'); $lastMonth = date('Ym', strtotime('last month')); $geoService = Services::get('geoStats'); $geoService->deleteMonthlyMetrics($this->month); $geoService->addMonthlyMetrics($this->month); if (!$this->site->getData('keepDailyUsageStats') && $this->month != $currentMonth && $this->month != $lastMonth) { $geoService->deleteDailyMetrics($this->month); } $counterService = Services::get('sushiStats'); $counterService->deleteMonthlyMetrics($this->month); $counterService->addMonthlyMetrics($this->month); if (!$this->site->getData('keepDailyUsageStats') && $this->month != $currentMonth && $this->month != $lastMonth) { $counterService->deleteDailyMetrics($this->month); } } }