diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-05-20 00:53:07 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-05-20 02:12:08 -0400 |
commit | efa99ed5253c229c83d8f2d98ee1c08b4383184e (patch) | |
tree | 6c91f0436eff5e31d9be892b6d2f2adfbb3a030c /init.go | |
parent | 747f4fb70ff61d3f8a7bb1bed896a913b0999450 (diff) | |
download | getwtxt-efa99ed5253c229c83d8f2d98ee1c08b4383184e.tar.gz |
endpoint query function added
Diffstat (limited to 'init.go')
-rw-r--r-- | init.go | 8 |
1 files changed, 7 insertions, 1 deletions
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) } }() |