- try {
- switch ($type) {
- case self::SETUP:
- $key = ReadinessCheck::KEY_DB_WRITE_PERMISSION_VERIFIED;
- $jsonData = json_decode($read->readFile(ReadinessCheck::SETUP_CRON_JOB_STATUS_FILE), true);
- break;
- case self::UPDATER:
- $key = self::UPDATER_KEY_FILE_PERMISSIONS_VERIFIED;
- $jsonData = json_decode($read->readFile(self::UPDATER_CRON_JOB_STATS_FILE), true);
- break;
- default:
- return ['success' => false, 'error' => 'Internal Error'];
- }
- } catch (\Magento\Framework\Exception\FileSystemException $e) {
- $error = 'Cron job has not been configured yet';
- if ($type == self::SETUP) {
- $error .= self::OTHER_CHECKS_WILL_FAIL_MSG;
- }
- return [
- 'success' => false,
- 'error' => $error