change sync endpoints to synchronous calls
This commit is contained in:
12
app/app.go
12
app/app.go
@@ -120,17 +120,17 @@ func Run() {
|
||||
})
|
||||
|
||||
router.POST("/sync", func(c *gin.Context) {
|
||||
go func() {
|
||||
//go func() {
|
||||
start := time.Now()
|
||||
log.Printf("Starting cluster sync\n")
|
||||
cluster.Sync()
|
||||
log.Printf("Synced cluster in %fs\n", time.Since(start).Seconds())
|
||||
}()
|
||||
//}()
|
||||
})
|
||||
|
||||
router.POST("/nodes/:node/sync", func(c *gin.Context) {
|
||||
nodeid := c.Param("node")
|
||||
go func() {
|
||||
//go func() {
|
||||
start := time.Now()
|
||||
log.Printf("Starting %s sync\n", nodeid)
|
||||
err := cluster.RebuildHost(nodeid)
|
||||
@@ -141,7 +141,7 @@ func Run() {
|
||||
log.Printf("Synced %s in %fs\n", nodeid, time.Since(start).Seconds())
|
||||
return
|
||||
}
|
||||
}()
|
||||
//}()
|
||||
})
|
||||
|
||||
router.POST("/nodes/:node/instances/:vmid/sync", func(c *gin.Context) {
|
||||
@@ -152,7 +152,7 @@ func Run() {
|
||||
return
|
||||
}
|
||||
|
||||
go func() {
|
||||
//go func() {
|
||||
start := time.Now()
|
||||
log.Printf("Starting %s.%d sync\n", nodeid, vmid)
|
||||
|
||||
@@ -176,7 +176,7 @@ func Run() {
|
||||
log.Printf("Synced %s.%d in %fs\n", nodeid, vmid, time.Since(start).Seconds())
|
||||
return
|
||||
}
|
||||
}()
|
||||
//}()
|
||||
})
|
||||
|
||||
router.Run("0.0.0.0:" + strconv.Itoa(config.ListenPort))
|
||||
|
@@ -253,8 +253,6 @@ func (instance *Instance) RebuildBoot() {
|
||||
eligibleBoot[string(k)] = true
|
||||
}
|
||||
|
||||
log.Println(eligibleBoot)
|
||||
|
||||
x := strings.Split(instance.configBoot, "order=") // should be a;b;c;d ...
|
||||
if len(x) == 2 {
|
||||
y := strings.Split(x[1], ";")
|
||||
|
Reference in New Issue
Block a user