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