Merge branch 'master' into kd-live

This commit is contained in:
2023-06-26 23:24:59 +09:00
3 changed files with 13 additions and 6 deletions

View File

@ -120,6 +120,7 @@ type houstonClient struct {
func unmarshal[T any](val *T, src map[string]string) {
argval := reflect.ValueOf(val)
logger.Println("operation receive :", argval.Type().Name(), src)
for i := 0; i < argval.Elem().Type().NumField(); i++ {
if !argval.Elem().Type().Field(i).IsExported() {
continue

View File

@ -21,7 +21,16 @@ import (
"golang.org/x/text/transform"
)
func download(dir string, urlpath string, accessToken string) (string, error) {
func download(dir string, urlpath string, accessToken string) (target string, err error) {
logger.Println("start downloading", dir, urlpath)
defer func() {
if err != nil {
logger.Println("downloading failed :", err)
} else {
logger.Println("downloading succeeded")
}
}()
parsed, err := url.Parse(urlpath)
if err != nil {
return "", err
@ -277,7 +286,6 @@ func (hc *houstonClient) deploy(req *shared.DeployRequest) error {
return err
}
logger.Println("start downloading", req.Url)
// verpath에 배포 시작
fname, err := download(root, hc.makeDownloadUrl(req.Url), req.AccessToken)
if err != nil {

View File

@ -121,8 +121,10 @@ func (h *houstonHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
var operation string
if r.Method == "POST" {
operation = r.FormValue("operation")
logger.Println("api called :", r.Form)
} else {
operation = r.URL.Query().Get("operation")
logger.Println("api called :", r.URL.Query())
}
if len(operation) == 0 {
@ -138,10 +140,6 @@ func (h *houstonHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
if r.PostForm == nil {
r.ParseMultipartForm(defaultMaxMemory)
}
args := []reflect.Value{
reflect.ValueOf(h),
reflect.ValueOf(w),