mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-16 18:36:21 +08:00
fix: Fix the problem of abnormal synchronization of the script library (#8631)
This commit is contained in:
parent
0941b0aad3
commit
c9f8c93083
1 changed files with 5 additions and 1 deletions
|
@ -199,7 +199,6 @@ func (u *ScriptService) Sync(req dto.OperateByTaskID) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("load scripts data.yaml from remote failed, err: %v", err)
|
||||
}
|
||||
fmt.Println(string(dataRes))
|
||||
|
||||
syncTask.Log("download successful!")
|
||||
var scripts Scripts
|
||||
|
@ -243,6 +242,11 @@ func (u *ScriptService) Sync(req dto.OperateByTaskID) error {
|
|||
if err := global.DB.Model(&model.Setting{}).Where("key = ?", "ScriptVersion").Updates(map[string]interface{}{"value": string(versionRes)}).Error; err != nil {
|
||||
return fmt.Errorf("update script version in db failed, err: %v", err)
|
||||
}
|
||||
go func() {
|
||||
if err := xpack.Sync(constant.SyncScripts); err != nil {
|
||||
global.LOG.Errorf("sync scripts to node failed, err: %v", err)
|
||||
}
|
||||
}()
|
||||
return nil
|
||||
}, nil)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue