소스 검색

Abort tasks when the deployment lock is present

Jordi Boggiano 12 년 전
부모
커밋
27a902d9a5
2개의 변경된 파일16개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/Packagist/WebBundle/Command/DumpPackagesCommand.php
  2. 8 0
      src/Packagist/WebBundle/Command/IndexPackagesCommand.php

+ 8 - 0
src/Packagist/WebBundle/Command/DumpPackagesCommand.php

@@ -45,6 +45,14 @@ class DumpPackagesCommand extends ContainerAwareCommand
         $force = (Boolean) $input->getOption('force');
         $verbose = (Boolean) $input->getOption('verbose');
 
+        $deployLock = $this->getContainer()->getParameter('kernel.cache_dir').'/deploy.globallock';
+        if (file_exists($deployLock)) {
+            if ($verbose) {
+                $output->writeln('Aborting, '.$deployLock.' file present');
+            }
+            return;
+        }
+
         $doctrine = $this->getContainer()->get('doctrine');
 
         if ($force) {

+ 8 - 0
src/Packagist/WebBundle/Command/IndexPackagesCommand.php

@@ -49,6 +49,14 @@ class IndexPackagesCommand extends ContainerAwareCommand
         $force = $input->getOption('force');
         $package = $input->getArgument('package');
 
+        $deployLock = $this->getContainer()->getParameter('kernel.cache_dir').'/deploy.globallock';
+        if (file_exists($deployLock)) {
+            if ($verbose) {
+                $output->writeln('Aborting, '.$deployLock.' file present');
+            }
+            return;
+        }
+
         $doctrine = $this->getContainer()->get('doctrine');
         $solarium = $this->getContainer()->get('solarium.client');