Skip to content

Commit 77b3d6b

Browse files
committed
Use busy_timeout for extralite adapter instead of busy_handler
1 parent f06a5d2 commit 77b3d6b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/enhanced_sqlite3/adapter.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,16 @@ def configure_connection
9393
private
9494

9595
def configure_busy_handler_timeout
96-
return unless @config.key?(:timeout)
97-
return if @config[:client] == "extralite" # extralite doesn't support busy_handler
96+
return unless @config[:timeout]
9897

9998
timeout = self.class.type_cast_config_to_integer(@config[:timeout])
10099
timeout_seconds = timeout.fdiv(1000)
100+
101+
if @config[:client] == "extralite"
102+
@raw_connection.busy_timeout(timeout_seconds)
103+
return
104+
end
105+
101106
retry_interval = 6e-5 # 60 microseconds
102107

103108
@raw_connection.busy_handler do |count|

0 commit comments

Comments
 (0)