[1.2] 리플레이

- 리플레이 파일 이름 유지하도록 수정
This commit is contained in:
2025-05-13 17:37:24 +09:00
parent 5f68795185
commit d8ccbf209c
3 changed files with 21 additions and 15 deletions

View File

@ -34,9 +34,9 @@ import (
)
type runcommand struct {
Exec string `json:"exec"`
Args []string `json:"args"`
Version string `json:"version"`
Exec string `json:"exec"`
Args []string `json:"args"`
Version string `json:"version"`
}
type clientConfig struct {
@ -98,9 +98,10 @@ func (pm *procmeta) setState(s protos.ProcessState) {
}
type uploadRequest struct {
filePath string
name string
version string
filePath string
name string
version string
uploadedFileName string
}
type houstonClient struct {
@ -503,7 +504,7 @@ func NewClient(standalone bool) (HoustonClient, error) {
return hc, nil
}
func uploadSafe(url, filePath, name, version string) error {
func uploadSafe(url, filePath, name, version, uploadedFileName string) error {
defer func() {
r := recover()
if r != nil {
@ -537,7 +538,10 @@ func uploadSafe(url, filePath, name, version string) error {
// createTime := file.
httpreq.Header.Set("Houston-Service-Name", name)
httpreq.Header.Set("Houston-Service-Version", version)
httpreq.Header.Set("Houston-Service-Filename", t.BirthTime().UTC().Format(time.DateOnly)+"."+hn+path.Ext(filePath))
if len(uploadedFileName) == 0 {
uploadedFileName = t.BirthTime().UTC().Format(time.DateOnly) + "." + hn + path.Ext(filePath)
}
httpreq.Header.Set("Houston-Service-Filename", uploadedFileName)
httpreq.Header.Set("Content-Type", "application/zip")
resp, err := http.DefaultClient.Do(httpreq)
if err != nil {
@ -581,7 +585,7 @@ func (hc *houstonClient) Start() {
url := hc.config.HttpAddress + "/upload"
for req := range hc.uploadChan {
logger.Println("uploadSafe :", req)
err := uploadSafe(url, req.filePath, req.name, req.version)
err := uploadSafe(url, req.filePath, req.name, req.version, req.uploadedFileName)
if err != nil {
logger.Println("uploadSafe return err :", err)
}
@ -630,8 +634,8 @@ func (hc *houstonClient) Start() {
logger.Println("autorun success :", sr)
}
}
}
}
}
for {
select {