ajayd-san/gomanagedocker

BUG ๐Ÿž: UI hangs sometimes when stopping a container

Closed this issue ยท 3 comments

Describe the bug
The UI hangs sometimes when stopping (pressing s) a container randomly.

Expected behavior
There should be no lag when i hit s to stop.

Desktop:

  • OS: platform independent
  • gmd Version: 1.3

Additional context
This is because we run ToggleStartStop on the main go routine, so if this operation takes time it naturally hangs the UI.

	if curItem != nil {
		containerId := curItem.(dockerRes).getId()
		err := m.dockerClient.ToggleStartStopContainer(containerId)

		if err != nil {
			m.activeDialog = teadialog.NewErrorDialog(err.Error(), m.width)
			m.showDialog = true
		}

	}

So, the fix would be to run ToggleStartStop on a different go routine and use m.possibleLongRunningOpErrorChan channel to send errors if any.

Let me know if any one needs any additional info.

i can take a look at this @ajayd-san

@ashishkhuraishy go for it!

Let me know if you need any details.

fixed in v1.4