-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add parameters for PostgreSQL #16641
Conversation
322f594
to
ef12b04
Compare
Codecov Report
@@ Coverage Diff @@
## main #16641 +/- ##
===========================================
+ Coverage 44.25% 66.43% +22.18%
===========================================
Files 244 1012 +768
Lines 13389 108540 +95151
Branches 2678 2675 -3
===========================================
+ Hits 5925 72110 +66185
- Misses 7177 32475 +25298
- Partials 287 3955 +3668
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days. |
/remove Stale |
@chlins we need to validate it before merging. |
@sayaoailun Hi, please rebase your pr with main branch, thanks! |
@chlins Done. |
@sayaoailun Hi, thanks, but recently we've merged the beego upgrade to the main which may have conflicts and impacts to your pr, so maybe you need to rebase again and then revise the code because beego orm update have some changes in this part. |
@chlins Done. |
@sayaoailun Thanks your work! I'll merge it after verification. |
src/common/dao/pgsql.go
Outdated
@@ -96,6 +100,10 @@ func (p *pgsql) Register(alias ...string) error { | |||
return err | |||
} | |||
|
|||
db, _ := orm.GetDB(an) | |||
db.SetConnMaxLifetime(p.connMaxLifetime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sayaoailun Please review the code(line 98), there are some difference after beego upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chlins Fixed.
src/common/dao/pgsql.go
Outdated
return err | ||
} | ||
|
||
db, _ := orm.GetDB(an) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd better check error here to avoid db is nil then will panic in the next line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chlins Fixed.
f8d506d
to
1561be7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@sayaoailun Please check the CI action, the UTTEST failed. |
Signed-off-by: sayaoailun <[email protected]>
@chlins Fixed. |
Signed-off-by: sayaoailun <[email protected]> Signed-off-by: Maksym <[email protected]>
Signed-off-by: sayaoailun <[email protected]> Signed-off-by: Stephan Hohn <[email protected]>
add
conn_max_lifetime
andconn_max_idle_time