Skip to content

Commit

Permalink
Merge pull request #447 from kongfei605/oracle_fix
Browse files Browse the repository at this point in the history
Oracle fix
  • Loading branch information
kongfei605 committed Apr 8, 2023
2 parents 1f76ef2 + 8898458 commit 9c67cc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conf/input.oracle/oracle.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # collect interval
# interval = 15

[[instances]]
#[[instances]]
# address = "10.1.2.3:1521/orcl"
# username = "monitor"
# password = "123456"
Expand Down
8 changes: 8 additions & 0 deletions inputs/oracle/oracle_linux_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ func (ins *Instance) Init() error {
return fmt.Errorf("failed to open oracle connection: %v", err)
}

if ins.MaxOpenConnections == 0 {
ins.MaxOpenConnections = 2
}

ins.client.SetMaxOpenConns(ins.MaxOpenConnections)
ins.client.SetMaxIdleConns(ins.MaxOpenConnections)
ins.client.SetConnMaxIdleTime(time.Duration(0))
ins.client.SetConnMaxLifetime(time.Duration(0))

return nil
}

Expand Down

0 comments on commit 9c67cc5

Please sign in to comment.