浏览代码

release package dumper lock in case of exceptions too in order to make possible next dumper command runs

fduch 9 年之前
父节点
当前提交
d9e169fac2
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/Packagist/WebBundle/Command/DumpPackagesCommand.php

+ 5 - 2
src/Packagist/WebBundle/Command/DumpPackagesCommand.php

@@ -86,8 +86,11 @@ class DumpPackagesCommand extends ContainerAwareCommand
             return;
         }
 
-        $result = $this->getContainer()->get('packagist.package_dumper')->dump($ids, $force, $verbose);
-        $lock->release();
+        try {
+             $result = $this->getContainer()->get('packagist.package_dumper')->dump($ids, $force, $verbose);
+        } finally {
+             $lock->release();
+        }
 
         return $result ? 0 : 1;
     }