File tree 1 file changed +6
-8
lines changed
src/pydiverse/pipedag/backend/lock 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -50,22 +50,20 @@ def acquire(self, lockable: Lockable):
50
50
lock_path = self .lock_path (lockable )
51
51
self .locks [lockable ] = fl .FileLock (lock_path )
52
52
53
- f_lock = self .locks [lockable ]
54
- if not f_lock .is_locked :
53
+ lock = self .locks [lockable ]
54
+ if not lock .is_locked :
55
55
self .logger .info (f"Locking '{ lockable } '" )
56
- f_lock .acquire ()
56
+ lock .acquire ()
57
57
self .set_lock_state (lockable , LockState .LOCKED )
58
58
59
59
def release (self , lockable : Lockable ):
60
60
if lockable not in self .locks :
61
61
raise LockError (f"No lock '{ lockable } ' found." )
62
62
63
- f_lock = self .locks [lockable ]
64
- f_lock .release ()
65
-
66
- if not f_lock .is_locked :
63
+ lock = self .locks [lockable ]
64
+ lock .release ()
65
+ if not lock .is_locked :
67
66
self .logger .info (f"Unlocking '{ lockable } '" )
68
- os .remove (f_lock .lock_file )
69
67
del self .locks [lockable ]
70
68
self .set_lock_state (lockable , LockState .UNLOCKED )
71
69
You can’t perform that action at this time.
0 commit comments