Removing volume directory fix
Directory mounted in the container wasn't removed along the container so we ended up with a lot of empty directories on the server.
This commit is contained in:
parent
81b3d45a4b
commit
c11de8a3e9
@ -62,7 +62,7 @@ func du(path string) (int, int, error) {
|
|||||||
return space, inodes, nil
|
return space, inodes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removes content of given directory
|
// Removes content of given directory and then the directory itself
|
||||||
func removeDirectory(dir string) error {
|
func removeDirectory(dir string) error {
|
||||||
d, err := os.Open(dir)
|
d, err := os.Open(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -79,6 +79,12 @@ func removeDirectory(dir string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = os.Remove(filepath.Join(dir))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user