Skip to content

Commit

Permalink
Don't delete entries that are set to 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
relistan committed May 12, 2016
1 parent 296f527 commit d6de7dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/docker/attacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ func (m *AttachManager) writeSinceFile(t time.Time) {
// Eject since containers that are too old to keep so we don't build up
// a list forever.
for container, lastSeen := range m.sinces.Containers {
if lastSeen == 0 {
continue
}

if lastSeen < time.Now().Unix() - int64(m.containerExpiryDays) * 3600 * 24 {
delete(m.sinces.Containers, container)
}
Expand Down Expand Up @@ -293,7 +297,7 @@ func (m *AttachManager) attach(id string, client DockerClient) error {
// We haven't seen it, add it to our sinces.
m.sinces.Containers[id] = 0

// And set the since appropriately from our settings
// And set the since appropriately from our settings.
if !m.newContainersReplayLogs {
// Use the last global since time when we connect to it
since = m.sinces.Since
Expand Down

0 comments on commit d6de7dc

Please sign in to comment.