修复无法删除的 bug
This commit is contained in:
parent
bdd93bd7d2
commit
c9bc688391
@ -49,9 +49,9 @@ func (y *Yggdrasil) delTexture(ctx context.Context, userProfileID int, textureTy
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
path := filepath.Join(y.TexturePath, t.TextureHash[:2], t.TextureHash[2:4], t.TextureHash)
|
path := filepath.Join(y.config.TexturePath, t.TextureHash[:2], t.TextureHash[2:4], t.TextureHash)
|
||||||
err = os.Remove(path)
|
err = os.Remove(path)
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Texture 表中删除记录
|
// Texture 表中删除记录
|
||||||
|
@ -14,11 +14,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Yggdrasil struct {
|
type Yggdrasil struct {
|
||||||
client *ent.Client
|
client *ent.Client
|
||||||
cache cache.Cache
|
cache cache.Cache
|
||||||
config config.Config
|
config config.Config
|
||||||
prikey *rsa.PrivateKey
|
prikey *rsa.PrivateKey
|
||||||
TexturePath string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewYggdrasil(client *ent.Client, cache cache.Cache, c config.Config, prikey *rsa.PrivateKey) *Yggdrasil {
|
func NewYggdrasil(client *ent.Client, cache cache.Cache, c config.Config, prikey *rsa.PrivateKey) *Yggdrasil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user