Skip to content

Commit 003b986

Browse files
authored
Fix concetion pool & timeout (issues #82) (#86)
fix concetion pool & timeout (issue #82) Signed-off-by: zamani <[email protected]>
1 parent 1b4f95c commit 003b986

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ This plugin takes advantage of ActiveRecord underneath. For `host`, `port`, `dat
148148
* **username** RDBMS login user name
149149
* **password** RDBMS login password
150150
* **socket** RDBMS socket path
151+
* **pool** A connection pool synchronizes thread access to a limited number of database connections
152+
* **timeout** RDBMS connection timeout
151153
* **remove_tag_prefix** remove the given prefix from the events. See "tag_prefix" in "Input: Configuration". (optional)
152154

153155
\<table\> sections:

lib/fluent/plugin/out_sql.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class SQLOutput < Output
2828
config_param :remove_tag_prefix, :string, default: nil
2929
desc 'enable fallback'
3030
config_param :enable_fallback, :bool, default: true
31+
config_param :pool, :integer, default: 10
32+
desc "specifies the timeout to establish a new connection to the database before failing"
33+
config_param :timeout, :integer, default: 5000
3134

3235
config_section :buffer do
3336
config_set_default :@type, DEFAULT_BUFFER_TYPE
@@ -190,6 +193,8 @@ def start
190193
password: @password,
191194
socket: @socket,
192195
schema_search_path: @schema_search_path,
196+
pool: @pool,
197+
timeout: @timeout,
193198
}
194199

195200
@base_model = Class.new(ActiveRecord::Base) do

0 commit comments

Comments
 (0)