Don't swap the int and cause a negative disk space... closes pterodactyl/panel#2401
This commit is contained in:
parent
bf1233def4
commit
7624502ec4
|
@ -704,7 +704,7 @@ func (fs *Filesystem) Delete(p string) error {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !st.IsDir() {
|
if !st.IsDir() {
|
||||||
atomic.SwapInt64(&fs.disk, -st.Size())
|
atomic.AddInt64(&fs.disk, -st.Size())
|
||||||
} else {
|
} else {
|
||||||
go func(st os.FileInfo, resolved string) {
|
go func(st os.FileInfo, resolved string) {
|
||||||
if s, err := fs.DirectorySize(resolved); err == nil {
|
if s, err := fs.DirectorySize(resolved); err == nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user