[relase] v0.1.18-unstable2
- restore network clean up
This commit is contained in:
parent
1430c399c6
commit
18432ca138
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.1.18-unstable",
|
||||
"version": "0.1.18-unstable2",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
|
|
|
@ -56,12 +56,7 @@ func onDockerCreated(containerID string) {
|
|||
BootstrapContainerFromTags(containerID)
|
||||
}
|
||||
|
||||
func onDockerDestroyed(containerID string) {
|
||||
utils.Debug("onDockerDestroyed: " + containerID)
|
||||
NetworkCleanUp()
|
||||
}
|
||||
|
||||
func onNetworkDisconnect(networkID string) {
|
||||
utils.Debug("onNetworkDisconnect: " + networkID)
|
||||
NetworkCleanUp()
|
||||
NetworkCleanUp(networkID)
|
||||
}
|
|
@ -221,8 +221,11 @@ func ConnectToNetworkSync(networkName string, containerID string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func NetworkCleanUp() {
|
||||
return
|
||||
func NetworkCleanUp(networkId) {
|
||||
if(networkId == "bridge" || networkId == "host" || networkId == "none") {
|
||||
return
|
||||
}
|
||||
|
||||
DockerNetworkLock <- true
|
||||
defer func() { <-DockerNetworkLock }()
|
||||
|
||||
|
|
Loading…
Reference in a new issue