# Fix OSS Build after maxOpenConnections

**URL:** <https://drone.discourse.group/t/fix-oss-build-after-maxopenconnections/9517>\
**Category:** Drone Bugs\
**Created:** [June 23, 2021, 1:59pm UTC](https://drone.discourse.group/t/fix-oss-build-after-maxopenconnections/9517 "2021-06-23T13:59:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawel\_Slotorsz](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/pawel_slotorsz/32/3131_2.png) [@Pawel\_Slotorsz](https://drone.discourse.group/u/Pawel_Slotorsz)\
**Post date:** [June 23, 2021, 1:59pm UTC](https://drone.discourse.group/t/fix-oss-build-after-maxopenconnections/9517/1 "2021-06-23T13:59:49Z")

</div>

Hi there,

after introducing maxOpenConnections in DB conns I encountered the below issue with OSS build. OSS version of the function has not been updated.

```auto
#11 42.58 cmd/drone-server/inject_store.go:63:19: too many arguments in call to db.Connect
#11 42.58 have (string, string, int)
#11 42.58 want (string, string)

```

Proposed fix as per contributing.md guidelines. Imho it does not harm to have it consistent even if it’s sqlite ([sql - The Go Programming Language](https://golang.org/pkg/database/sql/#DB.SetMaxOpenConns)).

```auto
index e401bd66..51df642a 100644
--- a/store/shared/db/conn_oss.go
+++ b/store/shared/db/conn_oss.go
@@ -26,7 +26,7 @@ import (
 )
 
 // Connect to an embedded sqlite database.
-func Connect(driver, datasource string) (*DB, error) {
+func Connect(driver, datasource string, maxOpenConnections int) (*DB, error) {
 	db, err := sql.Open(driver, datasource)
 	if err != nil {
 		return nil, err
@@ -34,6 +34,10 @@ func Connect(driver, datasource string) (*DB, error) {
 	if err := sqlite.Migrate(db); err != nil {
 		return nil, err
 	}
+
+ // generally set to 0, user configured for larger installs
+	db.SetMaxOpenConns(maxOpenConnections)
+
 	return &DB{
 		conn: sqlx.NewDb(db, driver),
 		lock: &sync.RWMutex{},

```

Cheers,  
Pawel S
