forgejo/routers/common
pat-s 63a80bf2b9 feat: use XORM EngineGroup instead of single Engine connection (#7212)
Resolves #7207

Add new configuration to make XORM work with a main and replicas database instances. The follow configuration parameters were added:

- `HOST_PRIMARY`
- `HOST_REPLICAS`
- `LOAD_BALANCE_POLICY`. Options:
    - `"WeightRandom"` -> `xorm.WeightRandomPolicy`
    - `"WeightRoundRobin`  -> `WeightRoundRobinPolicy`
    - `"LeastCon"` -> `LeastConnPolicy`
    - `"RoundRobin"` -> `xorm.RoundRobinPolicy()`
    - default: `xorm.RandomPolicy()`
- `LOAD_BALANCE_WEIGHTS`

Co-authored-by: pat-s <patrick.schratz@gmail.com@>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7212
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2025-03-30 11:34:02 +00:00
..
auth.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
compare.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
db.go feat: use XORM EngineGroup instead of single Engine connection (#7212) 2025-03-30 11:34:02 +00:00
errpage.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
errpage_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
markup.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
middleware.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
middleware_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
redirect.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
serve.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00