Fix slow querying of cross-signing signatures

This commit is contained in:
Neil Alexander 2022-10-24 10:07:50 +01:00
parent 0843bd776e
commit a553fe7705
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 12 additions and 7 deletions

View file

@ -99,7 +99,11 @@ func (r *queryKeysRequest) GetTimeout() time.Duration {
if r.Timeout == 0 {
return 10 * time.Second
}
return time.Duration(r.Timeout) * time.Millisecond
timeout := time.Duration(r.Timeout) * time.Millisecond
if timeout > time.Second*20 {
timeout = time.Second * 20
}
return timeout
}
func QueryKeys(req *http.Request, keyAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse {