Browse Source

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

fduch 9 năm trước cách đây
mục cha
commit
d9e169fac2
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  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;
     }