mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-12-18 17:08:29 +00:00
Re-use instead of reloading pre-warmed key
Signed-off-by: Mustafa Gezen <mustafa@ctrliq.com>
This commit is contained in:
parent
c691153e11
commit
8ef874b5ae
@ -110,16 +110,7 @@ func (s *Server) WarmGPGKey(key string, armoredKey string, gpgKey *crypto.Key, d
|
||||
// This means that the key is already loaded
|
||||
// We need to delete and replace it
|
||||
if cachedKey != nil {
|
||||
cachedKey.Lock()
|
||||
defer cachedKey.Unlock()
|
||||
|
||||
keyId := gpgKey.GetHexKeyID()
|
||||
err := s.deleteGpgKey(keyId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cachedKey.gpgId = keyId
|
||||
return cachedKey, nil
|
||||
}
|
||||
|
||||
err := s.importGpgKey(armoredKey)
|
||||
|
Loading…
Reference in New Issue
Block a user