fix: cancel deploy error

This commit is contained in:
Liujian
2025-02-18 10:20:33 +08:00
parent c10fa95cb3
commit 1011302721
2 changed files with 11 additions and 3 deletions
+2 -3
View File
@@ -4,8 +4,6 @@ go 1.23.4
toolchain go1.23.6
//toolchain go1.21.1
require (
github.com/eolinker/ap-account v1.0.15
github.com/eolinker/eosc v0.18.3
@@ -83,6 +81,7 @@ require (
// github.com/eolinker/eosc => ../../eolinker/eosc
//)
//replace github.com/eolinker/ap-account => ../aoaccount
//replace github.com/eolinker/ap-account => ../../eolinker/ap-account
//
//replace github.com/eolinker/go-common => ../../eolinker/go-common
+9
View File
@@ -354,6 +354,15 @@ func (i *imlLocalModel) SaveCache(ctx context.Context, model string, target stri
func (i *imlLocalModel) CancelDeploy(ctx context.Context, model string) error {
return i.transaction.Transaction(ctx, func(txCtx context.Context) error {
item, err := i.localModelCacheService.GetByTarget(ctx, ai_local.CacheTypeService, model)
if err != nil {
if !errors.Is(err, gorm.ErrRecordNotFound) {
return err
}
} else {
model = item.Model
}
list, err := i.localModelCacheService.List(ctx, model, ai_local.CacheTypeService)
if err != nil {
return err