summary refs log tree commit diff stats
path: root/svc/init.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-09 04:00:21 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-09 04:00:21 -0400
commit7410b8cd74d0f702b087577b1793bcf541ac8371 (patch)
treedbc1aa568abc43fd7048d0587eecbb2a4d950cbb /svc/init.go
parent7f76158b9565d804ada682c1a9aa83c22cb8de71 (diff)
downloadgetwtxt-7410b8cd74d0f702b087577b1793bcf541ac8371.tar.gz
init staticAssets explicitly on startup
Diffstat (limited to 'svc/init.go')
-rw-r--r--svc/init.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/svc/init.go b/svc/init.go
index 4408ecf..d585bfa 100644
--- a/svc/init.go
+++ b/svc/init.go
@@ -5,6 +5,7 @@ import (
 	"log"
 	"os"
 	"os/signal"
+	"sync"
 	"time"
 
 	"github.com/getwtxt/registry"
@@ -36,7 +37,10 @@ var tmpls *template.Template
 
 var twtxtCache = registry.NewIndex()
 
-var remoteRegistries = &RemoteRegistries{}
+var remoteRegistries = &RemoteRegistries{
+	Mu:   sync.RWMutex{},
+	List: make([]string, 0),
+}
 
 var staticCache = &staticAssets{}
 
@@ -63,7 +67,9 @@ func initSvc() {
 	initDatabase()
 	go cacheAndPush()
 	tmpls = initTemplates()
+	staticCache = initAssets()
 	watchForInterrupt()
+	pingAssets()
 }
 
 func checkFlags() {
n81'>81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141