fix(dbfs): set current version is not executed from existing transaction

This commit is contained in:
Aaron Liu
2025-04-27 10:37:33 +08:00
parent ca47f79ecb
commit 67d3b25c87
2 changed files with 6 additions and 6 deletions

View File

@@ -651,7 +651,8 @@ func (f *DBFS) setCurrentVersion(ctx context.Context, target *File, versionId in
return serializer.NewError(serializer.CodeDBError, "Failed to start transaction", err)
}
if err := f.fileClient.SetPrimaryEntity(ctx, target.Model, targetVersion.ID()); err != nil {
if err := fc.SetPrimaryEntity(ctx, target.Model, targetVersion.ID()); err != nil {
_ = inventory.Rollback(tx)
return serializer.NewError(serializer.CodeDBError, "Failed to set primary entity", err)
}