pathFinder = $pathFinder; } protected function configure() { $this ->setName('kupshop:upgrade') ->setDescription('Run database migrations'); } protected function execute(InputInterface $input, OutputInterface $output) { $upgrade = new \Upgrade($output->isVerbose()); try { $lock = $this->globalLockFactory->createLock('upgrade-lock'); if ($lock->acquire()) { $upgrade->run(); $lock->release(); } else { echo "Upgrade is already running \n"; getLogger()->notice('Upgrade is already running'); } } catch (\Exception $exception) { if (!isLocalDevelopment() && !getenv('CI')) { // capture exception to sentry getRaven()->setChannel(SentryLogger::CHANNEL_UPGRADE) ->captureException(new DatabaseUpgradeException('Neprošel upgrade databáze shopu', $exception->getCode(), $exception)); } throw $exception; } return 0; } }