Skip to content

Commit a06dec8

Browse files
committed
Merge pull request adamlaska#151 from mlaventure/ctr-retrieve-missed-events
Retrieve ctr missed events once connection is re-established
2 parents 471bb07 + 2b8ae55 commit a06dec8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ctr/container.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,13 +577,15 @@ var updateCommand = cli.Command{
577577
}
578578

579579
func waitForExit(c types.APIClient, events types.API_EventsClient, id, pid string, closer func()) {
580+
timestamp := uint64(time.Now().Unix())
580581
for {
581582
e, err := events.Recv()
582583
if err != nil {
583584
time.Sleep(1 * time.Second)
584-
events, _ = c.Events(netcontext.Background(), &types.EventsRequest{})
585+
events, _ = c.Events(netcontext.Background(), &types.EventsRequest{Timestamp: timestamp})
585586
continue
586587
}
588+
timestamp = e.Timestamp
587589
if e.Id == id && e.Type == "exit" && e.Pid == pid {
588590
closer()
589591
os.Exit(int(e.Status))

0 commit comments

Comments
 (0)