From 50221cf531a9e743bc9657a076a73d4153bae5f4 Mon Sep 17 00:00:00 2001 From: crapStone Date: Sat, 27 Apr 2024 23:38:49 +0200 Subject: [PATCH] format code --- server/certificates/certificates.go | 3 +-- server/dns/dns.go | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/certificates/certificates.go b/server/certificates/certificates.go index 6c5afaa..f48d1b7 100644 --- a/server/certificates/certificates.go +++ b/server/certificates/certificates.go @@ -33,12 +33,11 @@ func TLSConfig(mainDomainSuffix string, giteaClient *gitea.Client, acmeClient *AcmeClient, firstDefaultBranch string, - challengeCache cache.ICache, canonicalDomainCache cache.ICache, + challengeCache, canonicalDomainCache cache.ICache, certDB database.CertDB, noDNS01 bool, rawDomain string, ) *tls.Config { - keyCache, err := lru.New[string, tls.Certificate](32) if err != nil { panic(err) // This should only happen if 32 < 0 at the time of writing, which should be reason enough to panic. diff --git a/server/dns/dns.go b/server/dns/dns.go index e73f70c..e29e42c 100644 --- a/server/dns/dns.go +++ b/server/dns/dns.go @@ -8,8 +8,10 @@ import ( "github.com/hashicorp/golang-lru/v2/expirable" ) -const lookupCacheValidity = 30 * time.Second -const defaultPagesRepo = "pages" +const ( + lookupCacheValidity = 30 * time.Second + defaultPagesRepo = "pages" +) // TODO(#316): refactor to not use global variables var lookupCache *expirable.LRU[string, string] = expirable.NewLRU[string, string](4096, nil, lookupCacheValidity)