Skip to content

Commit

Permalink
Keep only one idle connection when idle
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Sep 23, 2021
1 parent 59553fe commit 0856f71
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions irods/session/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const (
IRODSSessionConnectionMaxMin = 5
// IRODSSessionConnectionMaxDefault is a default value for connection max
IRODSSessionConnectionMaxDefault = 10
// IRODSSessionIdleConnectionMax is a maximum number of idle connections
IRODSSessionIdleConnectionMax = 5
// IRODSSessionTimeoutDefault is a default value for timeout
IRODSSessionTimeoutDefault = 5 * time.Minute
)
Expand Down Expand Up @@ -38,7 +36,7 @@ func NewIRODSSessionConfig(applicationName string, operationTimeout time.Duratio
IdleTimeout: idleTimeout,
ConnectionMax: connectionMax,
ConnectionInitNumber: 1,
ConnectionMaxIdle: IRODSSessionIdleConnectionMax,
ConnectionMaxIdle: 1,
StartNewTransaction: startNewTransaction,
}
}
Expand All @@ -51,7 +49,7 @@ func NewIRODSSessionConfigWithDefault(applicationName string) *IRODSSessionConfi
IdleTimeout: IRODSSessionTimeoutDefault,
ConnectionMax: IRODSSessionConnectionMaxDefault,
ConnectionInitNumber: 1,
ConnectionMaxIdle: IRODSSessionIdleConnectionMax,
ConnectionMaxIdle: 1,
StartNewTransaction: true,
}
}

0 comments on commit 0856f71

Please sign in to comment.