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