Skip to content

Commit b2105ab

Browse files
authored
Merge pull request #4 from redcanaryco/fast-load
Moved update interval to end of loop
2 parents a262c9f + d5fae43 commit b2105ab

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ import (
1515
"encoding/json"
1616
"flag"
1717
"fmt"
18-
log "github.com/sirupsen/logrus"
1918
"os"
2019
"os/exec"
2120
"path/filepath"
21+
22+
log "github.com/sirupsen/logrus"
2223
)
2324

2425
// The global path to the bpftool binary

ui/explorer.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ func updateBpfPrograms() {
197197
}
198198
}
199199
}
200+
200201
enrichPrograms()
201202
lock.Unlock()
202203
}
@@ -216,8 +217,6 @@ func NewBpfExplorerView(t *Tui) *BpfExplorerView {
216217

217218
func (b *BpfExplorerView) Update() {
218219
for {
219-
time.Sleep(3 * time.Second)
220-
updateBpfPrograms()
221220
currentSelection := b.programList.GetCurrentItem()
222221

223222
tui.App.QueueUpdateDraw(func() {
@@ -226,6 +225,8 @@ func (b *BpfExplorerView) Update() {
226225
populateList(b.programList)
227226
b.programList.SetCurrentItem(currentSelection)
228227
})
228+
time.Sleep(3 * time.Second)
229+
updateBpfPrograms()
229230
}
230231
}
231232

0 commit comments

Comments
 (0)