mirror of
https://github.com/portainer/portainer.git
synced 2025-07-26 00:39:41 +02:00
fix(docker-proxy): reduce DB writes to optimize the proxy calls EE-5516 (#9148)
This commit is contained in:
parent
b37120802e
commit
74515f102d
7 changed files with 61 additions and 73 deletions
|
@ -347,9 +347,11 @@ func (bouncer *RequestBouncer) apiKeyLookup(r *http.Request) *portainer.TokenDat
|
|||
return nil
|
||||
}
|
||||
|
||||
// update the last used time of the key
|
||||
apiKey.LastUsed = time.Now().UTC().Unix()
|
||||
bouncer.apiKeyService.UpdateAPIKey(&apiKey)
|
||||
if now := time.Now().UTC().Unix(); now-apiKey.LastUsed > 60 { // [seconds]
|
||||
// update the last used time of the key
|
||||
apiKey.LastUsed = now
|
||||
bouncer.apiKeyService.UpdateAPIKey(&apiKey)
|
||||
}
|
||||
|
||||
return tokenData
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue