mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 01:24:13 +01:00
849de07064
Add a new optional `CONN_MAX_IDLETIME`[^1] This allows to set the `SetConnMaxIdleTime` on `database/sql`. It's useful to allow to close more idle connections to reduce database connections, especially on postgresql. For me i would like to use it to set a higher max idle connections but they will all be closed after being idle. So also the last idle connection will be closed when there is no load on forgejo. I also use it with max connection lifetime, because currently `database/sql` doesn't detect a postgresql master change[^2] and i'll get `[E] can't update runner status: pq: cannot execute UPDATE in a read-only transaction`[^3] on forgejo until the connection is closed. [^1]: https://pkg.go.dev/database/sql#DB.SetConnMaxIdleTime [^2]: https://stackoverflow.com/questions/51858659/how-to-safely-discard-golang-database-sql-pooled-connections-for-example-when-t [^3]: https://matrix.to/#/!zpNKWqkiEOyljSMQDK:matrix.org/$_AJft_amsGn5hXGOYw75JoBJQnW3aKJEpb-Iw53L_TU?via=schinas.net&via=matrix.org&via=nitro.chat Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2418 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-committed-by: Michael Kriese <michael.kriese@visualon.de> |
||
---|---|---|
.. | ||
actions | ||
activitypub | ||
analyze | ||
assetfs | ||
auth | ||
avatar | ||
base | ||
cache | ||
charset | ||
container | ||
context | ||
contexttest | ||
csv | ||
emoji | ||
eventsource | ||
generate | ||
git | ||
gitgraph | ||
gitrepo | ||
graceful | ||
hcaptcha | ||
highlight | ||
hostmatcher | ||
html | ||
httpcache | ||
httplib | ||
indexer | ||
issue/template | ||
json | ||
label | ||
lfs | ||
log | ||
markup | ||
mcaptcha | ||
metrics | ||
migration | ||
nosql | ||
optional | ||
options | ||
packages | ||
paginator | ||
pprof | ||
private | ||
process | ||
proxy | ||
proxyprotocol | ||
public | ||
queue | ||
recaptcha | ||
references | ||
regexplru | ||
repository | ||
secret | ||
session | ||
setting | ||
sitemap | ||
ssh | ||
storage | ||
structs | ||
svg | ||
sync | ||
system | ||
templates | ||
test | ||
testlogger | ||
timeutil | ||
translation | ||
turnstile | ||
typesniffer | ||
updatechecker | ||
upload | ||
uri | ||
user | ||
util | ||
validation | ||
web | ||
webhook |