mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-18 13:29:03 +08:00
Fix typo (#11287)
This commit is contained in:
parent
0f5410d225
commit
23a3a5cf74
5 changed files with 7 additions and 10 deletions
|
|
@ -33,7 +33,7 @@ type IAppRepo interface {
|
||||||
DeleteByIDs(ctx context.Context, ids []uint) error
|
DeleteByIDs(ctx context.Context, ids []uint) error
|
||||||
DeleteBy(opts ...DBOption) error
|
DeleteBy(opts ...DBOption) error
|
||||||
|
|
||||||
GetTopRecomment() ([]string, error)
|
GetTopRecommend() ([]string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewIAppRepo() IAppRepo {
|
func NewIAppRepo() IAppRepo {
|
||||||
|
|
@ -124,7 +124,7 @@ func (a AppRepo) GetBy(opts ...DBOption) ([]model.App, error) {
|
||||||
return apps, nil
|
return apps, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a AppRepo) GetTopRecomment() ([]string, error) {
|
func (a AppRepo) GetTopRecommend() ([]string, error) {
|
||||||
var (
|
var (
|
||||||
apps []model.App
|
apps []model.App
|
||||||
names []string
|
names []string
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import (
|
||||||
"github.com/1Panel-dev/1Panel/agent/utils/common"
|
"github.com/1Panel-dev/1Panel/agent/utils/common"
|
||||||
"github.com/1Panel-dev/1Panel/agent/utils/files"
|
"github.com/1Panel-dev/1Panel/agent/utils/files"
|
||||||
"github.com/1Panel-dev/1Panel/agent/utils/postgresql/client"
|
"github.com/1Panel-dev/1Panel/agent/utils/postgresql/client"
|
||||||
pgclient "github.com/1Panel-dev/1Panel/agent/utils/postgresql/client"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (u *BackupService) PostgresqlBackup(req dto.CommonBackup) error {
|
func (u *BackupService) PostgresqlBackup(req dto.CommonBackup) error {
|
||||||
|
|
@ -82,7 +81,7 @@ func handlePostgresqlBackup(db DatabaseHelper, parentTask *task.Task, recordID u
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
itemHandler := func() error { return doPostgresqlgBackup(db, targetDir, fileName, secret, backupTask) }
|
itemHandler := func() error { return doPostgresqlBackup(db, targetDir, fileName, secret, backupTask) }
|
||||||
if parentTask != nil {
|
if parentTask != nil {
|
||||||
return itemHandler()
|
return itemHandler()
|
||||||
}
|
}
|
||||||
|
|
@ -195,13 +194,13 @@ func handlePostgresqlRecover(req dto.CommonRecover, parentTask *task.Task, isRol
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func doPostgresqlgBackup(db DatabaseHelper, targetDir, fileName, secret string, task *task.Task) error {
|
func doPostgresqlBackup(db DatabaseHelper, targetDir, fileName, secret string, task *task.Task) error {
|
||||||
cli, err := LoadPostgresqlClientByFrom(db.Database)
|
cli, err := LoadPostgresqlClientByFrom(db.Database)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer cli.Close()
|
defer cli.Close()
|
||||||
backupInfo := pgclient.BackupInfo{
|
backupInfo := client.BackupInfo{
|
||||||
Database: db.Database,
|
Database: db.Database,
|
||||||
Name: db.Name,
|
Name: db.Name,
|
||||||
TargetDir: targetDir,
|
TargetDir: targetDir,
|
||||||
|
|
|
||||||
|
|
@ -1144,10 +1144,8 @@ func (u *ContainerService) ContainerStats(id string) (*dto.ContainerStats, error
|
||||||
|
|
||||||
body, err := io.ReadAll(res.Body)
|
body, err := io.ReadAll(res.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Body.Close()
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
res.Body.Close()
|
|
||||||
var stats *container.StatsResponse
|
var stats *container.StatsResponse
|
||||||
if err := json.Unmarshal(body, &stats); err != nil {
|
if err := json.Unmarshal(body, &stats); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ func (u *CronjobService) handleDatabase(cronjob model.Cronjob, startTime time.Ti
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if err := doPostgresqlgBackup(dbInfo, backupDir, record.FileName, cronjob.Secret, taskItem); err != nil {
|
if err := doPostgresqlBackup(dbInfo, backupDir, record.FileName, cronjob.Secret, taskItem); err != nil {
|
||||||
if retry < int(cronjob.RetryTimes) || !cronjob.IgnoreErr {
|
if retry < int(cronjob.RetryTimes) || !cronjob.IgnoreErr {
|
||||||
retry++
|
retry++
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ func (u *DashboardService) LoadAppLauncher(ctx *gin.Context) ([]dto.AppLauncher,
|
||||||
}
|
}
|
||||||
|
|
||||||
showList, err := launcherRepo.ListName()
|
showList, err := launcherRepo.ListName()
|
||||||
defaultList, err := appRepo.GetTopRecomment()
|
defaultList, err := appRepo.GetTopRecommend()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return data, nil
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue