From efa99ed5253c229c83d8f2d98ee1c08b4383184e Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Mon, 20 May 2019 00:53:07 -0400 Subject: endpoint query function added --- init.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'init.go') diff --git a/init.go b/init.go index ee76f01..60530ea 100644 --- a/init.go +++ b/init.go @@ -9,6 +9,7 @@ import ( "time" "github.com/fsnotify/fsnotify" + "github.com/getwtxt/registry" "github.com/spf13/pflag" "github.com/spf13/viper" ) @@ -28,6 +29,9 @@ var closelog = make(chan bool, 1) // templates var tmpls *template.Template +// registry index +var twtxtCache = registry.NewIndex() + func init() { checkFlags() titleScreen() @@ -156,10 +160,12 @@ func watchForInterrupt() { if !confObj.stdoutLogging { // signal to close the log file closelog <- true - time.Sleep(20 * time.Millisecond) } close(closelog) + + // Let everything catch up + time.Sleep(30 * time.Millisecond) os.Exit(0) } }() -- cgit 1.4.1-2-gfad0