Don't swap the int and cause a negative disk space... closes pterodactyl/panel#2401

This commit is contained in:
Dane Everitt 2020-09-24 21:19:46 -07:00
parent bf1233def4
commit 7624502ec4
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -704,7 +704,7 @@ func (fs *Filesystem) Delete(p string) error {
}
} else {
if !st.IsDir() {
atomic.SwapInt64(&fs.disk, -st.Size())
atomic.AddInt64(&fs.disk, -st.Size())
} else {
go func(st os.FileInfo, resolved string) {
if s, err := fs.DirectorySize(resolved); err == nil {