lib/locky.rb in locky-0.0.1 vs lib/locky.rb in locky-0.0.2
- old
+ new
@@ -10,12 +10,14 @@
end
def lock(process)
raise Error, "#{name} already locked by #{locked_by}" if locked?
adapter[name] = process
- yield
- ensure
- adapter.delete name
+ begin
+ yield
+ ensure
+ adapter.delete name
+ end
end
def locked?
adapter.key? name
end
\ No newline at end of file