Skip to content

Commit

Permalink
[analyze] Bandaid solution for occasional slow startups (#3191)
Browse files Browse the repository at this point in the history
* [analyze] Bandaid solution for occasional slow startups

* Speed up shutdown

* Add link to upstream issue

---------

Co-authored-by: Dustin Decker <[email protected]>
  • Loading branch information
mcastorina and dustin-decker authored Aug 7, 2024
1 parent ab8c843 commit 7730fc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 0 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"strings"
"sync"
"syscall"
"time"

"github.com/alecthomas/kingpin/v2"
"github.com/felixge/fgprof"
Expand Down Expand Up @@ -338,9 +337,6 @@ func run(state overseer.State) {
} else {
logger.Info("cleaned temporary artifacts")
}

time.Sleep(time.Second * 10)
logger.Info("10 seconds elapsed. Forcing shutdown.")
os.Exit(0)
}()

Expand Down
8 changes: 8 additions & 0 deletions pkg/analyzer/tui/keytype.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,11 @@ func (i KeyTypeItem) ID() string { return string(i) }
func (i KeyTypeItem) Title() string { return string(i) }
func (i KeyTypeItem) Description() string { return "" }
func (i KeyTypeItem) FilterValue() string { return string(i) }

func init() {
// Preload HasDarkBackground call. For some reason, if we don't do
// this, the TUI can take a noticeably long time to start. We should
// investigate further, but this is a good-enough bandaid for now.
// See: https://github.com/charmbracelet/lipgloss/issues/73
_ = lipgloss.HasDarkBackground()
}

0 comments on commit 7730fc8

Please sign in to comment.