소스 검색

btrfs only commit when job succeeded

bigeagle 11 년 전
부모
커밋
2a609f6eb7
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      tunasync/btrfs_snapshot.py

+ 3 - 2
tunasync/btrfs_snapshot.py

@@ -20,8 +20,9 @@ class BtrfsHook(JobHook):
     def before_job(self, *args, **kwargs):
         self._create_working_snapshot()
 
-    def after_job(self, *args, **kwargs):
-        self._commit_changes()
+    def after_job(self, status=None, *args, **kwargs):
+        if status == "success":
+            self._commit_changes()
 
     def _ensure_subvolume(self):
         # print(self.service_dir)