prevent race condition on starting an already running service
This commit is contained in:
@@ -16,7 +16,6 @@ func Trap(gr *run.Group, cancel context.CancelFunc) {
|
|||||||
<-stop
|
<-stop
|
||||||
return nil
|
return nil
|
||||||
}, func(err error) {
|
}, func(err error) {
|
||||||
close(stop)
|
|
||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ func AuthBasic(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.AuthBasic.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ func AuthBearer(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.AuthBearer.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ func Gateway(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.Gateway.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ func Groups(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.Groups.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ func Sharing(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.Sharing.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ func StorageHome(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.StorageHome.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ func StoragePublicLink(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.StoragePublicLink.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ func StorageUsers(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.StorageUsers.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ func Users(cfg *config.Config) *cli.Command {
|
|||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
if !cfg.Reva.StorageMetadata.Supervised {
|
if !cfg.Reva.Users.Supervised {
|
||||||
sync.Trap(&gr, cancel)
|
sync.Trap(&gr, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user