settings = $settings; $this->query = $cache; $this->queue = $queue; } /** * Check if the preload is finished. * * @return void */ public function check_finished() { if ( ( ! $this->queue->has_remaining_tasks() && ! $this->query->has_pending_jobs() ) || ! $this->settings->is_enabled() ) { delete_transient( 'wpr_preload_running' ); return; } $this->queue->add_job_preload_job_check_finished_async(); } }