mirror of
https://github.com/goharbor/harbor
synced 2024-09-21 10:58:08 +00:00
Move security/readonly middleware ahead of transaction middleware
In v2.1 security/readonly middleware will query DB by creating new connection. If it is put after transaction middleware there's a bigger chance of deadlock if the concurrent open connections are set too low (#13155) This commit mitigates that issue. But we still need work to lower the connections and better handle the case when http connection is closed. Signed-off-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
parent
2f64eb95b9
commit
a773ef358f
|
@ -74,9 +74,9 @@ func MiddleWares() []beego.MiddleWare {
|
||||||
csrf.Middleware(),
|
csrf.Middleware(),
|
||||||
orm.Middleware(),
|
orm.Middleware(),
|
||||||
notification.Middleware(), // notification must ahead of transaction ensure the DB transaction execution complete
|
notification.Middleware(), // notification must ahead of transaction ensure the DB transaction execution complete
|
||||||
transaction.Middleware(dbTxSkippers...),
|
|
||||||
artifactinfo.Middleware(),
|
artifactinfo.Middleware(),
|
||||||
security.Middleware(),
|
security.Middleware(),
|
||||||
readonly.Middleware(readonlySkippers...),
|
readonly.Middleware(readonlySkippers...),
|
||||||
|
transaction.Middleware(dbTxSkippers...),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user