Просмотр исходного кода

Close the key manager before shutting down.

Mariano Cano 6 лет назад
Родитель
Сommit
c02fe77998
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      authority/authority.go

+ 4 - 0
authority/authority.go

@@ -6,6 +6,7 @@ import (
 	"crypto/sha256"
 	"crypto/x509"
 	"encoding/hex"
+	"log"
 	"sync"
 	"time"
 
@@ -327,5 +328,8 @@ func (a *Authority) GetDatabase() db.AuthDB {
 
 // Shutdown safely shuts down any clients, databases, etc. held by the Authority.
 func (a *Authority) Shutdown() error {
+	if err := a.keyManager.Close(); err != nil {
+		log.Printf("error closing the key manager: %v", err)
+	}
 	return a.db.Shutdown()
 }