protected function setUrlStatus(URL $url, $isValid)
    {
        try {
            $updateStruct = $this->urlService->createUpdateStruct();
            $updateStruct->isValid = $isValid;
            $updateStruct->lastChecked = new DateTime();

            $this->urlService->updateUrl($url, $updateStruct);

            $this->logger->info(sprintf('URL id = %d (%s) was checked (valid = %s)', $url->id, $url->url, (int) $isValid));
        } catch (Exception $e) {
            $this->logger->error(sprintf('Cannot update URL id = %d status: %s', $url->id, $url->url));
        }
    }