mirror of
https://github.com/wagoodman/dive
synced 2026-03-14 14:25:50 +01:00
Merge pull request #232 from wagoodman/mysterious-hello-world-167
add sleep to prevent termbox race condition
This commit is contained in:
commit
07af6d785b
1 changed files with 8 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
"github.com/wagoodman/dive/dive/filetree"
|
||||
|
|
@ -113,6 +114,13 @@ func Run(options Options) {
|
|||
cache := filetree.NewFileTreeCache(result.RefTrees)
|
||||
cache.Build()
|
||||
|
||||
// it appears there is a race condition where termbox.Init() will
|
||||
// block nearly indefinitely when running as the first process in
|
||||
// a Docker container when started within ~25ms of container startup.
|
||||
// I can't seem to determine the exact root cause, however, a large
|
||||
// enough sleep will prevent this behavior (todo: remove this hack)
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
ui.Run(result, cache)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue