Changes as per review

This commit is contained in:
glendsoza 2022-01-17 21:54:07 +05:30
parent 98357e07a0
commit 31d080d909
3 changed files with 8 additions and 2 deletions

View file

@ -467,7 +467,6 @@ func (c *DockerCommand) RefreshImages() error {
ownImages := make([]*Image, len(images))
for i, image := range images {
// func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error)
firstTag := ""
tags := image.RepoTags

View file

@ -197,6 +197,11 @@ type UpdateConfig struct {
// It expects a valid duration like: 100ms, 2s, 200ns
// for docs see: https://golang.org/pkg/time/#ParseDuration
DockerRefreshInterval time.Duration `yaml:"dockerRefreshInterval,omitempty"`
// ImageRefreshInterval determines the time betweens updates of docker images
// It expects a valid duration like: 100ms, 2s, 200ns
// for docs see: https://golang.org/pkg/time/#ParseDuration
ImageRefreshInterval time.Duration `yaml:"imageRefreshInterval,omitempty"`
}
// GraphConfig specifies how to make a graph of recorded container stats
@ -398,6 +403,7 @@ func GetDefaultConfig() UserConfig {
OS: GetPlatformDefaultConfig(),
Update: UpdateConfig{
DockerRefreshInterval: time.Millisecond * 100,
ImageRefreshInterval: time.Millisecond * 30000,
},
Stats: StatsConfig{
MaxDuration: duration,

View file

@ -241,12 +241,13 @@ func (gui *Gui) Run() error {
gui.waitForIntro.Add(1)
dockerRefreshInterval := gui.Config.UserConfig.Update.DockerRefreshInterval
imageRefeshInterval := gui.Config.UserConfig.Update.ImageRefreshInterval
go func() {
gui.waitForIntro.Wait()
gui.goEvery(time.Millisecond*30, gui.reRenderMain)
gui.goEvery(dockerRefreshInterval, gui.refreshProject)
gui.goEvery(dockerRefreshInterval, gui.refreshContainersAndServices)
gui.goEvery(time.Millisecond*30000, gui.refreshImages)
gui.goEvery(imageRefeshInterval, gui.refreshImages)
gui.goEvery(dockerRefreshInterval, gui.refreshVolumes)
gui.goEvery(time.Millisecond*1000, gui.DockerCommand.UpdateContainerDetails)
gui.goEvery(time.Millisecond*1000, gui.checkForContextChange)