()
| 170 | } |
| 171 | |
| 172 | func (b *localBackend) Close() error { |
| 173 | // Ensure any in-progress sessionStore initialization is observed |
| 174 | // before reading b.store. If sessionStore was never called, the Do |
| 175 | // runs an empty closure and b.store stays nil. |
| 176 | b.storeOnce.Do(func() {}) |
| 177 | if b.store == nil { |
| 178 | return nil |
| 179 | } |
| 180 | return b.store.Close() |
| 181 | } |
| 182 | |
| 183 | // remoteBackend talks to a docker-agent server. |
| 184 | type remoteBackend struct { |