cleanup; fix environment stats not reporting network TX correctly

This commit is contained in:
Dane Everitt
2021-01-06 20:47:44 -08:00
parent 963a906c30
commit 1937d0366d
4 changed files with 19 additions and 45 deletions

View File

@@ -76,6 +76,10 @@ func (e *Environment) Attach() error {
}
}()
// Block the completion of this routine until the container is no longer running. This allows
// the pollResources function to run until it needs to be stopped. Because the container
// can be polled for resource usage, even when sropped, we need to have this logic present
// in order to cancel the context and therefore stop the routine that is spawned.
ok, err := e.client.ContainerWait(ctx, e.Id, container.WaitConditionNotRunning)
select {
case <-ctx.Done():