init app.watches and only query for new watches if we have a token

This commit is contained in:
Aaron Bieber 2022-12-21 19:35:05 -07:00
parent 8438b18e91
commit dd97ec3184

View File

@ -50,6 +50,7 @@ func main() {
log.Fatal("can't open database: ", err)
}
app.watches = &WatchResults{}
app.queries = data.New(db)
app.tsServer = &tsnet.Server{
Hostname: *name,
@ -147,7 +148,7 @@ func main() {
go func() {
for {
if dbExists {
if dbExists && ghToken != "" {
var err error
app.watches, err = UpdateWatches(ghToken)
if err != nil {