[ Agent ] [ App ] - add mysql init

This commit is contained in:
zeaslity
2023-11-28 10:02:00 +08:00
parent 2b53a2d62a
commit 076004c573
3 changed files with 6 additions and 3 deletions

View File

@@ -497,7 +497,7 @@ func (op *AgentOsOperator) loadMysqlInitScript(funcArgs []string) (bool, []strin
}
}
jackeyLove := funcArgs[8]
if !strings.HasSuffix(jackeyLove, "tar.gz") {
if !strings.HasSuffix(jackeyLove, "tar") {
return false, []string{
"[loadMysqlInitScript]- jackeyLove 有误!",
}
@@ -506,6 +506,8 @@ func (op *AgentOsOperator) loadMysqlInitScript(funcArgs []string) (bool, []strin
jackeyLoveLocalPrefix := "/root/wdd/jackeylove/"
BasicCreateFolder(jackeyLoveLocalPrefix)
jackeyLoveFolder := strings.Split(jackeyLove, ".tar")[0]
ok, resultLog := BasicDownloadFile(op.OssOfflinePrefix+"jackeyLove", jackeyLoveLocalPrefix+jackeyLove)
if !ok {
return false, append(resultLog, "[loadMysqlInitScript]- jackeyLove 下载失败!")
@@ -525,7 +527,7 @@ func (op *AgentOsOperator) loadMysqlInitScript(funcArgs []string) (bool, []strin
}
// list all sql file and sort and convert to []string
files, err := os.ReadDir(jackeyLoveLocalPrefix)
files, err := os.ReadDir(jackeyLoveLocalPrefix + jackeyLoveFolder)
if err != nil {
return false, []string{
"[loadMysqlInitScript]- read unzipped jackeylove error ",

View File

@@ -67,7 +67,6 @@ func MysqlSqlFileLoad(jackeyLoveFileList []string) (bool, []string) {
}
log.DebugF("[MysqlSqlFileLoad] - jackeyLoveFile %s execute success !", jackeyLove.Name())
}
return true, append(jackeyLoveFileList, "[MysqlSqlFileLoad] all file loaded !")