flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit add182fc510af8887560e8eacc910e379d80f49b
parent a3f617a39458b331e2181c436e00e7f1c01d5506
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat,  9 Jan 2021 16:52:10 -0800

fix domain map

Diffstat:
Mdb.go | 4+++-
Mmain.go | 1+
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/db.go b/db.go @@ -102,8 +102,10 @@ func getActiveUserNames() ([]string, error) { 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() { diff --git a/main.go b/main.go @@ -48,6 +48,7 @@ func main() { // load domains in memory refreshDomainMap() + fmt.Println(domains) switch args[0] { case "serve":