mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-05-11 12:57:49 +00:00
Add redis for caching, first try during a train ride so expect it to not be working yet
This commit is contained in:
parent
b8b9886ee1
commit
5b6eecc75f
12 changed files with 149 additions and 32 deletions
server/dns
|
@ -1,11 +1,10 @@
|
|||
package dns
|
||||
|
||||
import (
|
||||
"github.com/OrlovEvgeny/go-mcache"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"codeberg.org/codeberg/pages/server/cache"
|
||||
)
|
||||
|
||||
// lookupCacheTimeout specifies the timeout for the DNS lookup cache.
|
||||
|
@ -15,7 +14,7 @@ var defaultPagesRepo = "pages"
|
|||
|
||||
// GetTargetFromDNS searches for CNAME or TXT entries on the request domain ending with MainDomainSuffix.
|
||||
// If everything is fine, it returns the target data.
|
||||
func GetTargetFromDNS(domain, mainDomainSuffix, firstDefaultBranch string, dnsLookupCache cache.ICache) (targetOwner, targetRepo, targetBranch string) {
|
||||
func GetTargetFromDNS(domain, mainDomainSuffix, firstDefaultBranch string, dnsLookupCache *mcache.CacheDriver) (targetOwner, targetRepo, targetBranch string) {
|
||||
// Get CNAME or TXT
|
||||
var cname string
|
||||
var err error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue