修复无法删除的 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 {
|
||||
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)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return err
|
||||
}
|
||||
// Texture 表中删除记录
|
||||
|
@ -18,7 +18,6 @@ type Yggdrasil struct {
|
||||
cache cache.Cache
|
||||
config config.Config
|
||||
prikey *rsa.PrivateKey
|
||||
TexturePath string
|
||||
}
|
||||
|
||||
func NewYggdrasil(client *ent.Client, cache cache.Cache, c config.Config, prikey *rsa.PrivateKey) *Yggdrasil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user