GetDeployingProgress 추가
This commit is contained in:
@ -5,23 +5,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func pof2(x int64) (out int64) {
|
|
||||||
out = 1
|
|
||||||
org := x
|
|
||||||
for (x >> 1) > 0 {
|
|
||||||
out = out << 1
|
|
||||||
x = x >> 1
|
|
||||||
}
|
|
||||||
if org > out {
|
|
||||||
out = out << 1
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDownload(t *testing.T) {
|
func TestDownload(t *testing.T) {
|
||||||
//download(".", "https://kdcc.action2quare.com/houston/_deploys/game/0.18.186.1/game.zip", "", nil)
|
//download(".", "https://kdcc.action2quare.com/houston/_deploys/game/0.18.186.1/game.zip", "", nil)
|
||||||
fmt.Println(pof2(1023))
|
fmt.Println(pof2(1023, 1024))
|
||||||
fmt.Println(pof2(1024))
|
fmt.Println(pof2(1024, 1024))
|
||||||
fmt.Println(pof2(1025))
|
fmt.Println(pof2(1025, 1024))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -517,3 +517,7 @@ func (h *houstonHandler) GetLogFileLinks(w http.ResponseWriter, r *http.Request)
|
|||||||
enc := json.NewEncoder(w)
|
enc := json.NewEncoder(w)
|
||||||
enc.Encode(out)
|
enc.Encode(out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *houstonHandler) GetDeployingProgress(w http.ResponseWriter, r *http.Request) {
|
||||||
|
json.NewEncoder(w).Encode(h.Operation().DeplyingProgress())
|
||||||
|
}
|
||||||
|
|||||||
@ -418,6 +418,10 @@ func (os *operationServer) Hosts() map[string]hostSnapshot {
|
|||||||
return os.hp.allHosts()
|
return os.hp.allHosts()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (os *operationServer) DeplyingProgress() []*protos.DeployingProgress {
|
||||||
|
return os.db.clone()
|
||||||
|
}
|
||||||
|
|
||||||
func newOperationServer() *operationServer {
|
func newOperationServer() *operationServer {
|
||||||
return &operationServer{
|
return &operationServer{
|
||||||
hp: hostPool{
|
hp: hostPool{
|
||||||
|
|||||||
@ -108,6 +108,7 @@ type Operation interface {
|
|||||||
RestartProcess(RestartProcessRequest)
|
RestartProcess(RestartProcessRequest)
|
||||||
Upload(UploadRequest)
|
Upload(UploadRequest)
|
||||||
Hosts() map[string]hostSnapshot
|
Hosts() map[string]hostSnapshot
|
||||||
|
DeplyingProgress() []*protos.DeployingProgress
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadServerConfig() serverConfig {
|
func loadServerConfig() serverConfig {
|
||||||
|
|||||||
Reference in New Issue
Block a user