Adapt to new sql model

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-10-02 00:20:04 +02:00
parent 7d7acbcf14
commit 7a4046ad65
4 changed files with 11 additions and 24 deletions

View File

@@ -28,9 +28,9 @@ import (
type (
Selector struct {
pg *pg.Client
cache sync.Map
encryptionKey cipher.EncryptionKey
pg *pg.Client
cache sync.Map
encryptionKey cipher.EncryptionKey
}
)
@@ -44,7 +44,6 @@ func NewSelector(
}
}
func (s *Selector) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error) {
domain := hello.ServerName
@@ -114,10 +113,6 @@ func (s *Selector) rebuildCacheEntry(ctx context.Context, conn pg.Conn, domain s
return fmt.Errorf("cannot load domain: %w", err)
}
if !customDomain.IsActive {
return fmt.Errorf("domain is not active")
}
if customDomain.SSLStatus != coredata.CustomDomainSSLStatusActive {
return fmt.Errorf("domain does not have active SSL certificate")
}
@@ -153,7 +148,6 @@ func (s *Selector) rebuildCacheEntry(ctx context.Context, conn pg.Conn, domain s
return nil
}
func (s *Selector) ClearCache() {
s.cache.Range(
func(key, _ any) bool {