Skip to content

Commit

Permalink
chore: remove unused result from pg_advisory_lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Phanindra Srungavarapu authored and Phanindra Srungavarapu committed Sep 18, 2024
1 parent 7eb80ee commit 4a0a4fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sequel/extensions/pg_advisory_lock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# locks to be registered because different threads running the same code
# should not cause a Sequel::Error to be raised.
# Also, I wanted it to use Concurrent::Hash for multi-threaded environments.
# Made minor change in begin ensure block in with_advisory_lock method.

require "sequel"
require "zlib"
Expand Down Expand Up @@ -57,10 +58,9 @@ def with_advisory_lock(name, id = nil)
synchronize do
if get(Sequel.function(lock_function, *function_params))
begin
result = yield
yield
ensure
get(Sequel.function(UNLOCK_FUNCTION, *function_params))
result
end
end
end
Expand Down

0 comments on commit 4a0a4fa

Please sign in to comment.