mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-27 01:02:34 +01:00
skip transaction for POST /service/token (#19339)
Habor doesnot support POST /service/token endpoint, put this request into a transaction will consume extra database resources and generate many logs. Signed-off-by: bin liu <liubin0329@gmail.com>
This commit is contained in:
parent
ee6f61c502
commit
5a576174b1
@ -55,6 +55,7 @@ var (
|
|||||||
dbTxSkippers = []middleware.Skipper{
|
dbTxSkippers = []middleware.Skipper{
|
||||||
middleware.MethodAndPathSkipper(http.MethodPatch, distribution.BlobUploadURLRegexp),
|
middleware.MethodAndPathSkipper(http.MethodPatch, distribution.BlobUploadURLRegexp),
|
||||||
middleware.MethodAndPathSkipper(http.MethodPut, distribution.BlobUploadURLRegexp),
|
middleware.MethodAndPathSkipper(http.MethodPut, distribution.BlobUploadURLRegexp),
|
||||||
|
middleware.MethodAndPathSkipper(http.MethodPost, match("^/service/token")),
|
||||||
func(r *http.Request) bool { // skip tx for GET, HEAD and Options requests
|
func(r *http.Request) bool { // skip tx for GET, HEAD and Options requests
|
||||||
m := r.Method
|
m := r.Method
|
||||||
return m == http.MethodGet || m == http.MethodHead || m == http.MethodOptions
|
return m == http.MethodGet || m == http.MethodHead || m == http.MethodOptions
|
||||||
|
Loading…
Reference in New Issue
Block a user