Skip to content

Commit d099c63

Browse files
committed
refactor: inline the busy wait suspension
1 parent 55348d8 commit d099c63

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

  • lib/solid_objects/database_adapters
  • sig/generated/lib/solid_objects/database_adapters

‎lib/solid_objects/database_adapters/sqlite.rb‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def with_transaction_deadline(connection)
7171
return yield unless busy_wait
7272

7373
begin
74-
suspend_busy_wait(connection, busy_wait)
74+
connection.execute("PRAGMA busy_timeout = 0")
7575
yield
7676
ensure
7777
restore_busy_wait(connection, busy_wait)
@@ -89,11 +89,6 @@ def restorable_busy_wait(connection)
8989
{ pragma_timeout: }
9090
end
9191

92-
# @rbs (untyped, Hash[Symbol, untyped]) -> void
93-
def suspend_busy_wait(connection, _busy_wait)
94-
connection.execute("PRAGMA busy_timeout = 0")
95-
end
96-
9792
# @rbs (untyped, Hash[Symbol, untyped]) -> void
9893
def restore_busy_wait(connection, busy_wait)
9994
handler_timeout = busy_wait[:handler_timeout]

‎sig/generated/lib/solid_objects/database_adapters/sqlite.rbs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ module SolidObjects
2929
# @rbs (untyped) -> Hash[Symbol, untyped]?
3030
def restorable_busy_wait: (untyped) -> Hash[Symbol, untyped]?
3131

32-
# @rbs (untyped, Hash[Symbol, untyped]) -> void
33-
def suspend_busy_wait: (untyped, Hash[Symbol, untyped]) -> void
34-
3532
# @rbs (untyped, Hash[Symbol, untyped]) -> void
3633
def restore_busy_wait: (untyped, Hash[Symbol, untyped]) -> void
3734

0 commit comments

Comments
 (0)