all repos — flounder @ add182fc510af8887560e8eacc910e379d80f49b

A small site builder for the Gemini protocol

fix domain map
alex wennerberg alex@alexwennerberg.com
Sat, 09 Jan 2021 16:52:10 -0800
commit

add182fc510af8887560e8eacc910e379d80f49b

parent

a3f617a39458b331e2181c436e00e7f1c01d5506

2 files changed, 4 insertions(+), 1 deletions(-)

jump to
M db.godb.go

@@ -102,8 +102,10 @@

var domains map[string]string func refreshDomainMap() error { - rows, err := DB.Query(`SELECT domain, username from user WHERE domain != nil`) + domains = make(map[string]string) + rows, err := DB.Query(`SELECT domain, username from user WHERE domain != ""`) if err != nil { + log.Println(err) return err } for rows.Next() {
M main.gomain.go

@@ -48,6 +48,7 @@ }

// load domains in memory refreshDomainMap() + fmt.Println(domains) switch args[0] { case "serve":